源代码:
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
private ActionContributionItem preferenceItem;
private ActionContributionItem quitItem;
private ActionContributionItem resetPerspectiveItem;
private ActionContributionItem aboutItem;
public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
super(configurer);
}
protected void makeActions(IWorkbenchWindow window) {
preferenceItem = createItem(ActionFactory.PREFERENCES, window);
quitItem = createItem(ActionFactory.QUIT, window);
resetPerspectiveItem = createItem(ActionFactory.RESET_PERSPECTIVE, window);
aboutItem = createItem(ActionFactory.ABOUT, window);
}
private ActionContributionItem createItem(ActionFactory factory, IWorkbenchWindow window) {
final IWorkbenchAction action = factory.create(window);
register(action);
return new ActionContributionItem(action);
}
protected void fillMenuBar(IMenuManager menuBar) {
MenuManager fileMenu = new MenuManager("&文件", IWorkbenchActionConstants.M_FILE);
MenuManager winMenu = new MenuManager("&窗口", IWorkbenchActionConstants.M_WINDOW);
MenuManager helpMenu = new MenuManager("&帮助", IWorkbenchActionConstants.M_HELP);
winMenu.add(preferenceItem);
final Separator quitSeparator = new Separator("vega.quit");
fileMenu.add(quitSeparator);
fileMenu.add(quitItem);
MenuManager viewMenu = new MenuManager("Show View");
winMenu.add(viewMenu);
winMenu.add(resetPerspectiveItem);
menuBar.add(fileMenu);
menuBar.insertAfter(IWorkbenchActionConstants.M_FILE, winMenu);
menuBar.insertAfter(IWorkbenchActionConstants.M_WINDOW, helpMenu);
final Separator helpSeparator = new Separator("vega.help");
helpMenu.add(helpSeparator);
helpMenu.add(aboutItem);
if(Util.isMac()) {
preferenceItem.setVisible(false);
quitItem.setVisible(false);
quitSeparator.setVisible(false);
aboutItem.setVisible(false);
}
}
5 个解决方案
#1
汉化~~~~~
#2
是啊,求讲解啊
#3
下载汉化包。
#4
似乎没用吧?现在我找到messages.properties文件,里面显示的是各个工具栏的名称,但是无法修改
#5
这个是eclipse 自己用NLS做的汉化,参考下NLS
#1
汉化~~~~~
#2
是啊,求讲解啊
#3
下载汉化包。
#4
似乎没用吧?现在我找到messages.properties文件,里面显示的是各个工具栏的名称,但是无法修改
#5
这个是eclipse 自己用NLS做的汉化,参考下NLS