首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

Eclipse RCP平添新建窗口、关于和退出菜单选项

2012-07-20 
Eclipse RCP添加新建窗口、关于和退出菜单选项ApplicationActionBarAdvisor.java?private IWorkbenchAction

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);}

热点排行