if( additions==null || !(additions instanceof GroupMarker) ){
manager.add(navigateMenu);
}else{
manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, navigateMenu);
}
navigateMenu.add(new GroupMarker(IWorkbenchActionConstants.NAV_START));
navigateMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
navigateMenu.add(new GroupMarker(IWorkbenchActionConstants.NAV_END));
}
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
// we are using the global BACK and FORWARD actions here
// and will register "handlers" for these commands
navigateMenu.appendToGroup(IWorkbenchActionConstants.NAV_END,
ActionFactory.BACK.create(window));
navigateMenu.appendToGroup(IWorkbenchActionConstants.NAV_END,
ActionFactory.FORWARD.create(window));
if (!manager.isVisible()){
// since this is the top level menu bar why would it not be visible?
manager.setVisible(true);
}
IMenuManager mapMenu = manager.findMenuUsingPath("map");
if( mapMenu == null ){
// Once again the hosting RCP application should of provided
// us with a Map menu; but let's be careful and make our own here
// if needed.
// See UDIGActionBarAdvisor for hosting requirements.
mapMenu = new MenuManager(Messages.ToolManager_menu_manager_title, "map");
manager.add(mapMenu);
mapMenu.add(new GroupMarker("mapStart"));
mapMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
mapMenu.add(new GroupMarker("mapEnd"));
}
// churn through each category and add stuff as needed
// note we check with the cmdService to see what we if the actionSet
// associated with this cateogry is turned on by the
// current perspective.