Eclipse RCP添加新建窗口、关于和退出菜单选项
ApplicationActionBarAdvisor.java
?
private IWorkbenchAction newWindowAction;private IWorkbenchAction aboutWindowAction;private IWorkbenchAction exitWindowAction;public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {super(configurer);}protected void makeActions(IWorkbenchWindow window) {newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create(window);register(newWindowAction);newWindowAction.setText("新建新窗口");aboutWindowAction = ActionFactory.ABOUT.create(window);register(aboutWindowAction);aboutWindowAction.setText("关于我们");exitWindowAction = ActionFactory.QUIT.create(window);register(exitWindowAction);exitWindowAction.setText("退出");}protected void fillMenuBar(IMenuManager menuBar) {MenuManager fileMenuManager = new MenuManager("&文件",IWorkbenchActionConstants.M_FILE);fileMenuManager.add(newWindowAction);//fileMenuManager.add(new Separator());添加分割线fileMenuManager.add(aboutWindowAction);fileMenuManager.add(exitWindowAction);menuBar.add(fileMenuManager);}