List of usage examples for org.eclipse.jface.action GroupMarker GroupMarker
public GroupMarker(String groupName)
From source file:fede.plugin.workspace.filters.CustomFiltersActionGroup.java
License:Apache License
/** * Fills the given view menu with the entries managed by the * group.//w w w.j a v a 2 s . c o m * * @param viewMenu the menu to fill */ public void fillViewMenu(IMenuManager viewMenu) { if (fMenuManager != null) throw new IllegalStateException("FilleViewMenu allready called"); fMenuManager = viewMenu; /* * Don't change the separator group name. * Using this name ensures that other filters * get contributed to the same group. */ fMenuManager.add(new Separator("filters")); //$NON-NLS-1$ fMenuManager.add(new GroupMarker(RECENT_FILTERS_GROUP_NAME)); fMenuManager.add(new ShowFilterDialogAction()); fMenuListener = new IMenuListener() { public void menuAboutToShow(IMenuManager manager) { removePreviousLRUFilterActions(manager); addLRUFilterActions(manager); } }; fMenuManager.addMenuListener(fMenuListener); }
From source file:fede.workspace.tool.view.content.WSContentView.java
License:Apache License
private void fillContextMenu(IMenuManager manager) { manager.add(new GroupMarker(WS_MB_ADDITIONS)); manager.add(new Separator()); manager.add(showLinkType);/*from ww w .j a va 2s. co m*/ manager.add(showToolTips); manager.add(showLinkTypeName); manager.add(showKind); manager.add(openItem); manager.add(new Separator()); drillDownAdapter.addNavigationActions(manager); manager.add(new Separator()); // Other plug-ins can contribute there actions here manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); manager.add(new Separator()); PropertyDialogAction a = new PropertyDialogAction(getSite(), fTreeViewer); manager.add(a); }
From source file:force.ApplicationActionBarAdvisor.java
License:LGPL
protected void fillMenuBar(IMenuManager menuBar) { MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE); MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP); menuBar.add(fileMenu);/*from www .ja v a 2 s . c o m*/ // Add a group marker indicating where action set menus will appear. menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); menuBar.add(helpMenu); // File // fileMenu.add(newWindowAction); // fileMenu.add(new Separator()); // fileMenu.add(connectAction); // fileMenu.add(saveAction); // fileMenu.add(openAction); // fileMenu.add(openViewAction); // fileMenu.add(new Separator()); fileMenu.add(exitAction); // Help helpMenu.add(aboutAction); }
From source file:fr.imag.adele.cadse.eclipse.view.AbstractCadseTreeViewUI.java
License:Apache License
protected void fillContextMenu(IMenuManager manager) { fillActionSet(manager);/*from w w w . j a v a2 s .c o m*/ manager.add(new GroupMarker(WS_MB_ADDITIONS)); // manager.add(new Separator()); manager.add(showToolTips); manager.add(showLinkTypeName); manager.add(showKind); manager.add(showIncomings); fillflags(manager); manager.add(new Separator()); drillDownAdapter.addNavigationActions(manager); manager.add(new Separator()); // Other plug-ins can contribute there actions here manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); // manager.add(new Separator()); manager.add(openPropertyView); // PropertyDialogAction a = new PropertyDialogAction(getSite(), // fTreeViewer); // manager.add(a); }
From source file:gda.rcp.ApplicationActionBarAdvisor.java
License:Open Source License
/** * Fills the coolbar with the workbench actions. *//*from www .jav a2 s .c o m*/ @Override protected void fillCoolBar(ICoolBarManager coolBar) { IActionBarConfigurer2 actionBarConfigurer = (IActionBarConfigurer2) getActionBarConfigurer(); { // File Group IToolBarManager fileToolBar = actionBarConfigurer.createToolBarManager(); fileToolBar.add(new Separator(IWorkbenchActionConstants.NEW_GROUP)); /* * we need to ensure a wizard is on teh menu otherwise we expose a NPE in CustomisePerpespective * perspective.setNewWizardActionIds(getVisibleIDs(wizards)); */ fileToolBar.add(newWizardAction); fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT)); fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_GROUP)); fileToolBar.add(saveAction); // NOTE Intentionally added, rich bean editors can change bean name. If not required // add new system property and set that to turn this off. fileToolBar.add(saveAsAction); fileToolBar.add(new Separator(IWorkbenchActionConstants.EDIT_START)); fileToolBar.add(undoAction); fileToolBar.add(redoAction); fileToolBar.add(new Separator(IWorkbenchActionConstants.EDIT_END)); fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT)); // fileToolBar.add(getPrintItem()); fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT)); fileToolBar.add(new Separator(IWorkbenchActionConstants.BUILD_GROUP)); fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.BUILD_EXT)); fileToolBar.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); // Add to the cool bar manager coolBar.add(actionBarConfigurer.createToolBarContributionItem(fileToolBar, IWorkbenchActionConstants.TOOLBAR_FILE)); } // coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); // coolBar.add(new GroupMarker(IIDEActionConstants.GROUP_NAV)); // { // Navigate group // IToolBarManager navToolBar = actionBarConfigurer.createToolBarManager(); // navToolBar.add(new Separator( // IWorkbenchActionConstants.HISTORY_GROUP)); // navToolBar // .add(new GroupMarker(IWorkbenchActionConstants.GROUP_APP)); // navToolBar.add(backwardHistoryAction); // navToolBar.add(forwardHistoryAction); // navToolBar.add(new Separator(IWorkbenchActionConstants.PIN_GROUP)); // navToolBar.add(pinEditorContributionItem); // // // Add to the cool bar manager // coolBar.add(actionBarConfigurer.createToolBarContributionItem(navToolBar, // IWorkbenchActionConstants.TOOLBAR_NAVIGATE)); // } // // coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_EDITOR)); // // coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_HELP)); // // { // Help group // IToolBarManager helpToolBar = actionBarConfigurer.createToolBarManager(); // helpToolBar.add(new Separator(IWorkbenchActionConstants.GROUP_HELP)); // // helpToolBar.add(searchComboItem); // // Add the group for applications to contribute // helpToolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_APP)); // // Add to the cool bar manager // coolBar.add(actionBarConfigurer.createToolBarContributionItem(helpToolBar, // IWorkbenchActionConstants.TOOLBAR_HELP)); // } }
From source file:gda.rcp.ApplicationActionBarAdvisor.java
License:Open Source License
@Override protected void fillMenuBar(IMenuManager menuBar) { menuBar.add(createFileMenu());//from w ww.j a v a 2s . c o m menuBar.add(createEditMenu()); // NOTE: This is where extension menus are added. menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); menuBar.add(createWindowMenu()); menuBar.add(createHelpMenu()); }
From source file:gda.rcp.ApplicationActionBarAdvisor.java
License:Open Source License
/** * Creates and returns the File menu/*from www . jav a2 s . c o m*/ */ private MenuManager createFileMenu() { MenuManager menu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE); // menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START)); // { // // create the New submenu, using the same id for it as the New action // String newText = "&New"; // String newId = ActionFactory.NEW.getId(); // MenuManager newMenu = new MenuManager(newText, newId); //// newMenu.setActionDefinitionId("org.eclipse.ui.file.newQuickMenu"); //$NON-NLS-1$ // newMenu.add(new Separator(newId)); // // this.newWizardMenu = new NewWizardMenu(getWindow()); // // newMenu.add(this.newWizardMenu); // newMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); // menu.add(newMenu); // } // We disable the standard "new" extension marker and replace with a gda one. // This is done in order to provide our own implementation of OpenLocalFileAction // (which is normally provided by org.eclipse.ui.ide) which does not allow easy // changes to default location. So we replace with one of our own. // menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT)); menu.add(new GroupMarker(NEW_GDA_EXT)); menu.add(new Separator()); 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(getRevertItem()); // menu.add(new Separator()); // menu.add(getMoveItem()); // menu.add(getRenameItem()); // menu.add(getRefreshItem()); // // menu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT)); // menu.add(new Separator()); // menu.add(getPrintItem()); // menu.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT)); // menu.add(new Separator()); // menu.add(openWorkspaceAction); // menu.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT)); // menu.add(new Separator()); // menu.add(importResourcesAction); // menu.add(exportResourcesAction); menu.add(new GroupMarker(IWorkbenchActionConstants.IMPORT_EXT)); menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); // menu.add(new Separator()); // menu.add(getPropertiesItem()); menu.add(ContributionItemFactory.REOPEN_EDITORS.create(getWindow())); menu.add(new GroupMarker(IWorkbenchActionConstants.MRU)); menu.add(new Separator()); if (LocalProperties.check(LocalProperties.GDA_GUI_USE_ACTIONS_EXPORT, true)) { menu.add(exportWizardAction); } if (LocalProperties.check(LocalProperties.GDA_GUI_USE_ACTIONS_IMPORT, true)) { menu.add(importWizardAction); } menu.add(new Separator()); // Add the test action here if (USE_TEST_ACTION) { menu.add(new Separator()); menu.add(testAction); } // Add NewWizardAction, appears as "Other..." on menu if (LocalProperties.check(LocalProperties.GDA_GUI_USE_ACTIONS_NEW, true)) { menu.add(newWizardAction); } // If we're on OS X we shouldn't show this command in the File menu. It // should be invisible to the user. However, we should not remove it - // the carbon UI code will do a search through our menu structure // looking for it when Cmd-Q is invoked (or Quit is chosen from the // application menu. ActionContributionItem quitItem = new ActionContributionItem(exitAction); quitItem.setVisible(!"carbon".equals(SWT.getPlatform())); //$NON-NLS-1$ menu.add(new Separator()); menu.add(quitItem); menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END)); return menu; }
From source file:gda.rcp.ApplicationActionBarAdvisor.java
License:Open Source License
/** * Creates and returns the Edit menu.//from w w w . j av a 2s . c o m */ private MenuManager createEditMenu() { MenuManager menu = new MenuManager("&Edit", IWorkbenchActionConstants.M_EDIT); menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START)); menu.add(undoAction); menu.add(redoAction); menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT)); menu.add(new Separator()); // menu.add(getCutItem()); // menu.add(getCopyItem()); // menu.add(getPasteItem()); menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT)); menu.add(new Separator()); // menu.add(getDeleteItem()); // menu.add(getSelectAllItem()); menu.add(new Separator()); menu.add(getCutItem()); menu.add(getCopyItem()); menu.add(getPasteItem()); menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT)); menu.add(new Separator()); menu.add(getDeleteItem()); menu.add(getSelectAllItem()); menu.add(new Separator()); menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END)); menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); return menu; }
From source file:gda.rcp.ApplicationActionBarAdvisor.java
License:Open Source License
/** * Creates and returns the Help menu./*from ww w. j a va2 s. co m*/ */ private MenuManager createHelpMenu() { MenuManager menu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP); addSeparatorOrGroupMarker(menu, "group.intro"); //$NON-NLS-1$ // See if a welcome or intro page is specified if (introAction != null) { menu.add(introAction); } /* * else if (quickStartAction != null) { menu.add(quickStartAction); } */ menu.add(helpAction); menu.add(new Separator()); menu.add(new GroupMarker("group.intro.ext")); //$NON-NLS-1$ addSeparatorOrGroupMarker(menu, "group.main"); //$NON-NLS-1$ // menu.add(helpContentsAction); // menu.add(helpSearchAction); // menu.add(dynamicHelpAction); // addSeparatorOrGroupMarker(menu, "group.assist"); //$NON-NLS-1$ // // See if a tips and tricks page is specified // if (tipsAndTricksAction != null) { // menu.add(tipsAndTricksAction); // } // HELP_START should really be the first item, but it was after // quickStartAction and tipsAndTricksAction in 2.1. menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START)); menu.add(new GroupMarker("group.main.ext")); //$NON-NLS-1$ addSeparatorOrGroupMarker(menu, "group.tutorials"); //$NON-NLS-1$ addSeparatorOrGroupMarker(menu, "group.tools"); //$NON-NLS-1$ addSeparatorOrGroupMarker(menu, "group.updates"); //$NON-NLS-1$ menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END)); addSeparatorOrGroupMarker(menu, IWorkbenchActionConstants.MB_ADDITIONS); // about should always be at the bottom menu.add(new Separator("group.about")); //$NON-NLS-1$ menu.add(aboutAction); // ActionContributionItem aboutItem = new ActionContributionItem(aboutAction); // aboutItem.setVisible(!"carbon".equals(SWT.getPlatform())); //$NON-NLS-1$ // menu.add(aboutItem); menu.add(new GroupMarker("group.about.ext")); //$NON-NLS-1$ return menu; }
From source file:gda.rcp.ApplicationActionBarAdvisor.java
License:Open Source License
/** * Adds a <code>GroupMarker</code> or <code>Separator</code> to a menu. The test for whether a separator should be * added is done by checking for the existence of a preference matching the string useSeparator.MENUID.GROUPID that * is set to <code>true</code>. * /*from w w w .jav a 2 s . com*/ * @param menu * the menu to add to * @param groupId * the group id for the added separator or group marker */ private void addSeparatorOrGroupMarker(MenuManager menu, String groupId) { String prefId = "useSeparator." + menu.getId() + "." + groupId; //$NON-NLS-1$ //$NON-NLS-2$ boolean addExtraSeparators = GDAClientActivator.getDefault().getPreferenceStore().getBoolean(prefId); if (addExtraSeparators) { menu.add(new Separator(groupId)); } else { menu.add(new GroupMarker(groupId)); } }