List of usage examples for org.eclipse.jface.action GroupMarker GroupMarker
public GroupMarker(String groupName)
From source file:oraloganalyzer.WorkbenchActionBuilder.java
License:Open Source License
/** * Fills the menu bar with the workbench actions. * //from w w w .j a v a2 s. co m * @param configurer */ public void populateMenuBar(IActionBarConfigurer configurer) { IMenuManager menubar = configurer.getMenuManager(); MenuManager menu = createFileMenu(); menubar.add(menu); menubar.add(createEditMenu()); menubar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); }
From source file:oraloganalyzer.WorkbenchActionBuilder.java
License:Open Source License
/** * Creates and returns the File menu.//from w ww.ja v a 2 s. c o m */ private MenuManager createFileMenu() { MenuManager menu = new MenuManager("&Datei", "Datei"); // IWorkbenchActionConstants.M_FILE); menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START)); menu.add(parseFileAction); menu.add(exportAction); menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT)); menu.add(closeAction); // menu.add(closeAllAction); // menu.add(closeAllSavedAction); menu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT)); // menu.add(new Separator()); // menu.add(saveAction); // menu.add(saveAsAction); // menu.add(saveAllAction); // menu.add(revertAction); menu.add(ContributionItemFactory.REOPEN_EDITORS.create(getWindow())); menu.add(new GroupMarker(IWorkbenchActionConstants.MRU)); menu.add(new Separator()); menu.add(quitAction); menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END)); return menu; }
From source file:org.apache.directory.studio.ApplicationActionBarAdvisor.java
License:Apache License
/** * Populates the Menu Bar/*from ww w .j a va 2 s.co m*/ */ protected void fillMenuBar(IMenuManager menuBar) { // Getting the OS String os = Platform.getOS(); // Creating menus MenuManager fileMenu = new MenuManager(Messages.getString("ApplicationActionBarAdvisor.file"), //$NON-NLS-1$ IWorkbenchActionConstants.M_FILE); MenuManager editMenu = new MenuManager(Messages.getString("ApplicationActionBarAdvisor.edit"), //$NON-NLS-1$ IWorkbenchActionConstants.M_EDIT); MenuManager navigateMenu = new MenuManager(Messages.getString("ApplicationActionBarAdvisor.navigate"), //$NON-NLS-1$ IWorkbenchActionConstants.M_NAVIGATE); MenuManager windowMenu = new MenuManager(Messages.getString("ApplicationActionBarAdvisor.windows"), //$NON-NLS-1$ IWorkbenchActionConstants.M_WINDOW); MenuManager helpMenu = new MenuManager(Messages.getString("ApplicationActionBarAdvisor.help"), //$NON-NLS-1$ IWorkbenchActionConstants.M_HELP); MenuManager hiddenMenu = new MenuManager("Hidden", "org.apache.directory.studio.rcp.hidden"); //$NON-NLS-1$ //$NON-NLS-2$ hiddenMenu.setVisible(false); // Adding menus menuBar.add(fileMenu); menuBar.add(editMenu); menuBar.add(navigateMenu); // Add a group marker indicating where action set menus will appear. menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); menuBar.add(windowMenu); menuBar.add(helpMenu); menuBar.add(hiddenMenu); // Populating File Menu fileMenu.add(newAction); fileMenu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT)); fileMenu.add(openFileAction); fileMenu.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT)); fileMenu.add(new Separator()); fileMenu.add(closeAction); fileMenu.add(closeAllAction); fileMenu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT)); fileMenu.add(new Separator()); fileMenu.add(saveAction); fileMenu.add(saveAsAction); fileMenu.add(saveAllAction); fileMenu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT)); fileMenu.add(new Separator()); fileMenu.add(refreshAction); fileMenu.add(new Separator()); fileMenu.add(printAction); fileMenu.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT)); fileMenu.add(new Separator()); fileMenu.add(importAction); fileMenu.add(exportAction); fileMenu.add(new GroupMarker(IWorkbenchActionConstants.IMPORT_EXT)); fileMenu.add(new Separator()); fileMenu.add(propertiesAction); fileMenu.add(reopenEditorsList); fileMenu.add(new GroupMarker(IWorkbenchActionConstants.MRU)); if (ApplicationActionBarAdvisor.OS_MACOSX.equalsIgnoreCase(os)) { // We hide the exit (quit) action, it will be added by the "Carbon" plugin hiddenMenu.add(exitAction); } else { fileMenu.add(new Separator()); fileMenu.add(exitAction); } // Populating Edit Menu editMenu.add(undoAction); editMenu.add(redoAction); editMenu.add(new Separator()); editMenu.add(cutAction); editMenu.add(copyAction); editMenu.add(pasteAction); editMenu.add(new Separator()); editMenu.add(deleteAction); editMenu.add(selectAllAction); editMenu.add(new Separator()); editMenu.add(moveAction); editMenu.add(renameAction); editMenu.add(new Separator()); editMenu.add(findAction); editMenu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT)); // Populating Navigate Menu navigateMenu.add(nextAction); navigateMenu.add(previousAction); navigateMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); navigateMenu.add(new GroupMarker(IWorkbenchActionConstants.NAV_END)); navigateMenu.add(new Separator()); navigateMenu.add(backwardHistoryAction); navigateMenu.add(forwardHistoryAction); // Window MenuManager perspectiveMenu = new MenuManager( Messages.getString("ApplicationActionBarAdvisor.openPerspective"), "openPerspective"); //$NON-NLS-1$ //$NON-NLS-2$ perspectiveMenu.add(perspectivesList); windowMenu.add(perspectiveMenu); MenuManager viewMenu = new MenuManager(Messages.getString("ApplicationActionBarAdvisor.showView")); //$NON-NLS-1$ viewMenu.add(viewsList); windowMenu.add(viewMenu); windowMenu.add(new Separator()); windowMenu.add(closePerspectiveAction); windowMenu.add(closeAllPerspectivesAction); if (ApplicationActionBarAdvisor.OS_MACOSX.equalsIgnoreCase(os)) { // We hide the preferences action, it will be added by the "Carbon" plugin hiddenMenu.add(preferencesAction); } else { windowMenu.add(new Separator()); windowMenu.add(preferencesAction); } // Help helpMenu.add(introAction); helpMenu.add(new Separator()); helpMenu.add(helpAction); helpMenu.add(dynamicHelpAction); helpMenu.add(new Separator()); helpMenu.add(reportABug); helpMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); if (ApplicationActionBarAdvisor.OS_MACOSX.equalsIgnoreCase(os)) { // We hide the about action, it will be added by the "Carbon" plugin hiddenMenu.add(aboutAction); } else { helpMenu.add(new Separator()); helpMenu.add(aboutAction); } }
From source file:org.apache.directory.studio.ApplicationActionBarAdvisor.java
License:Apache License
/** * Populates the Cool Bar/*from w w w .j a v a 2 s. com*/ */ protected void fillCoolBar(ICoolBarManager coolBar) { // add main tool bar IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT); toolbar.add(newDropDownAction); toolbar.add(saveAction); toolbar.add(printAction); toolbar.add(preferencesAction); coolBar.add(new ToolBarContributionItem(toolbar, Application.PLUGIN_ID + ".toolbar")); //$NON-NLS-1$ // add marker for additions coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); // add navigation tool bar // some actions are added from org.eclipse.ui.editor to the HISTORY_GROUP IToolBarManager navToolBar = new ToolBarManager(SWT.FLAT | SWT.RIGHT); navToolBar.add(new Separator(IWorkbenchActionConstants.HISTORY_GROUP)); navToolBar.add(backwardHistoryAction); navToolBar.add(forwardHistoryAction); coolBar.add(new ToolBarContributionItem(navToolBar, IWorkbenchActionConstants.TOOLBAR_NAVIGATE)); }
From source file:org.bbaw.pdr.ae.standalone.ApplicationActionBarAdvisor.java
License:Open Source License
@Override protected final void fillMenuBar(final IMenuManager menuBar) { // MenuManager fileMenu = new MenuManager("&File", // IWorkbenchActionConstants.M_FILE); // menuBar.add(fileMenu); // fileMenu.add(exitAction); MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP); // Help//www.ja va 2 s. c o m // XXX add an additions group because this is what SDK UI expects helpMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); helpMenu.add(new Separator()); helpMenu.add(_aboutAction); }
From source file:org.bbaw.pdr.ae.view.control.templates.aspectsemantic.controller.internal.EasyAspectTemplateEditor.java
License:Open Source License
protected void createMenus(final Composite st) { MenuManager menuMgr = new MenuManager(); menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() { @Override/*from w w w . ja va 2 s .co m*/ public void menuAboutToShow(IMenuManager mgr) { if (_editable) { fillMenu(mgr); } } }); Menu menu = menuMgr.createContextMenu(st); fillMenu(menuMgr); st.setMenu(menu); PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart().getSite() .registerContextMenu("org.bbaw.pdr.view.editorlite.menu", menuMgr, EasyAspectTemplateEditor.this); }
From source file:org.bbaw.pdr.ae.view.editorlite.view.EasyAspectEditor.java
License:Open Source License
protected void createMenus(final Control control) { MenuManager menuMgr = new MenuManager(); menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() { @Override/* w ww . j av a 2 s. co m*/ public void menuAboutToShow(IMenuManager mgr) { if (_editable) { fillMenu(mgr); } } }); Menu menu = menuMgr.createContextMenu(control); fillMenu(menuMgr); control.setMenu(menu); PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart().getSite() .registerContextMenu("org.bbaw.pdr.view.editorlite.menu", menuMgr, EasyAspectEditor.this); }
From source file:org.bbaw.pdr.ae.view.main.editors.AspectEditorDialog.java
License:Open Source License
/** * Creates the menus.//from w ww.j av a2 s . co m * @param control the control */ private final void createMenus(final Control control) { MenuManager menuMgr = new MenuManager(); Menu contextMenu = menuMgr.createContextMenu(control); menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() { @Override public void menuAboutToShow(final IMenuManager mgr) { fillMenu(mgr); } }); Menu menu = menuMgr.createContextMenu(control); fillMenu(menuMgr); control.setMenu(contextMenu); control.setMenu(menu); PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart().getSite() .registerContextMenu(AEPluginIDs.MENU_URI_ASPECT_EDITOR, menuMgr, AspectEditorDialog.this); }
From source file:org.bbaw.pdr.ae.view.main.views.Treeview.java
License:Open Source License
/** * Creates the menus.// www.j av a 2 s. co m * @param control the control */ protected final void createMenus(final Control control) { MenuManager menuMgr = new MenuManager(); menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() { @Override public void menuAboutToShow(final IMenuManager mgr) { fillMenu(mgr); } }); Menu menu = menuMgr.createContextMenu(control); fillMenu(menuMgr); control.setMenu(menu); getSite().registerContextMenu(menuMgr, Treeview.this); }
From source file:org.carrot2.workbench.core.ApplicationActionBarAdvisor.java
License:Open Source License
protected void fillMenuBar(IMenuManager menuBar) { final MenuManager fileMenu = new MenuManager("&File", "org.carrot2.menus.file"); fileMenu.add(closeAction);/*from w w w . j a v a 2 s . c o m*/ fileMenu.add(closeAllAction); fileMenu.add(new Separator()); fileMenu.add(saveAsAction); fileMenu.add(new Separator()); fileMenu.add(exitAction); final MenuManager aboutMenu = new MenuManager("&About", "org.carrot2.menus.about"); aboutMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); aboutMenu.add(aboutAction); final MenuManager changePerspMenuMgr = new MenuManager("Open Perspective", "org.carrot2.menus.openperspective"); changePerspMenuMgr.add(changePerspMenuItem); MenuManager showViewMenuMgr = new MenuManager("Show view", "org.carrot2.menus.showview"); showViewMenuMgr.add(showViewMenu); final MenuManager windowMenu = new MenuManager("&Window", "org.carrot2.menus.window"); windowMenu.add(changePerspMenuMgr); windowMenu.add(showViewMenuMgr); windowMenu.add(openPreferencesAction); menuBar.add(fileMenu); menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); menuBar.add(windowMenu); menuBar.add(aboutMenu); }