org.eclipse.ui.navigator.ICommonMenuConstants Java Examples
The following examples show how to use
org.eclipse.ui.navigator.ICommonMenuConstants.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ModulaEditor.java From xds-ide with Eclipse Public License 1.0 | 6 votes |
@Override protected void editorContextMenuAboutToShow(IMenuManager menu) { super.editorContextMenuAboutToShow(menu); addAction(menu, ICommonMenuConstants.GROUP_OPEN, OpenDeclarationsAction.ID); //$NON-NLS-1$ if (openInViewActionGroup != null) { openInViewActionGroup.fillContextMenu(menu); } if (declarationsSearchGroup != null) { declarationsSearchGroup.fillContextMenu(menu); } if (referencesSearchGroup != null) { referencesSearchGroup.fillContextMenu(menu); } }
Example #2
Source File: PythonActionProvider.java From Pydev with Eclipse Public License 1.0 | 6 votes |
@Override public void fillContextMenu(IMenuManager menu) { if (openResourceAction.isEnabledForSelectionWithoutContainers()) { menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, openResourceAction); } if (openPythonAction.isEnabledForSelectionWithoutContainers()) { menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, openPythonAction); } if (openExternalAction.isEnabledForSelectionWithoutContainers()) { menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, openExternalAction); } if (copyResourceAction.isEnabled()) { menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, copyResourceAction); } if (pasteAction.isEnabled()) { menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, pasteAction); } if (deleteResourceAction.isEnabled()) { menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, deleteResourceAction); } if (moveResourceAction.isEnabled()) { menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, moveResourceAction); } }
Example #3
Source File: LangNavigatorActionProvider.java From goclipse with Eclipse Public License 1.0 | 6 votes |
@Override public void fillContextMenu(IMenuManager menu) { IProject project = getBundleProjectFromSelection(); if(project == null) return; if(ResourcesPlugin.getWorkspace().isAutoBuilding()) { // This action is not otherwise shown if project is auto-building, so add it. IStructuredSelection structuredSel = getStructuredSelection(); if(structuredSel != null) { buildAction.selectionChanged(structuredSel); } menu.appendToGroup(ICommonMenuConstants.GROUP_BUILD, buildAction); } }
Example #4
Source File: EditActionGroup.java From tmxeditor8 with GNU General Public License v2.0 | 6 votes |
public void fillContextMenu(IMenuManager menu) { IStructuredSelection selection = (IStructuredSelection) getContext().getSelection(); boolean anyResourceSelected = !selection.isEmpty() && ResourceSelectionUtil.allResourcesAreOfType(selection, IResource.PROJECT | IResource.FOLDER | IResource.FILE); copyAction.selectionChanged(selection); // menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, copyAction); pasteAction.selectionChanged(selection); // menu.insertAfter(copyAction.getId(), pasteAction); // menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, pasteAction); if (anyResourceSelected) { deleteAction.selectionChanged(selection); // menu.insertAfter(pasteAction.getId(), deleteAction); menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, deleteAction); } }
Example #5
Source File: PortingActionProvider.java From tmxeditor8 with GNU General Public License v2.0 | 6 votes |
private void addExportMenu(IMenuManager aMenu) { exportWizardActionGroup.setContext(getContext()); if (exportWizardActionGroup.getWizardActionIds().length == 0) { aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, exportAction); return; } IMenuManager submenu = new MenuManager( WorkbenchNavigatorMessages.PortingActionProvider_ExportResourcesMenu_label, COMMON_NAVIGATOR_EXPORT_MENU); exportWizardActionGroup.fillContextMenu(submenu); submenu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS)); submenu.add(new Separator()); submenu.add(exportAction); aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, submenu); }
Example #6
Source File: PortingActionProvider.java From tmxeditor8 with GNU General Public License v2.0 | 6 votes |
private void addImportMenu(IMenuManager aMenu) { importWizardActionGroup.setContext(getContext()); if (importWizardActionGroup.getWizardActionIds().length == 0) { aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, importAction); return; } IMenuManager submenu = new MenuManager( WorkbenchNavigatorMessages.PortingActionProvider_ImportResourcesMenu_label, COMMON_NAVIGATOR_IMPORT_MENU); importWizardActionGroup.fillContextMenu(submenu); submenu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS)); submenu.add(new Separator()); submenu.add(importAction); aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, submenu); }
Example #7
Source File: EditActionGroup.java From translationstudio8 with GNU General Public License v2.0 | 6 votes |
public void fillContextMenu(IMenuManager menu) { IStructuredSelection selection = (IStructuredSelection) getContext().getSelection(); boolean anyResourceSelected = !selection.isEmpty() && ResourceSelectionUtil.allResourcesAreOfType(selection, IResource.PROJECT | IResource.FOLDER | IResource.FILE); copyAction.selectionChanged(selection); // menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, copyAction); pasteAction.selectionChanged(selection); // menu.insertAfter(copyAction.getId(), pasteAction); // menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, pasteAction); if (anyResourceSelected) { deleteAction.selectionChanged(selection); // menu.insertAfter(pasteAction.getId(), deleteAction); menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, deleteAction); } }
Example #8
Source File: PortingActionProvider.java From translationstudio8 with GNU General Public License v2.0 | 6 votes |
private void addExportMenu(IMenuManager aMenu) { exportWizardActionGroup.setContext(getContext()); if (exportWizardActionGroup.getWizardActionIds().length == 0) { aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, exportAction); return; } IMenuManager submenu = new MenuManager( WorkbenchNavigatorMessages.PortingActionProvider_ExportResourcesMenu_label, COMMON_NAVIGATOR_EXPORT_MENU); exportWizardActionGroup.fillContextMenu(submenu); submenu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS)); submenu.add(new Separator()); submenu.add(exportAction); aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, submenu); }
Example #9
Source File: PortingActionProvider.java From translationstudio8 with GNU General Public License v2.0 | 6 votes |
private void addImportMenu(IMenuManager aMenu) { importWizardActionGroup.setContext(getContext()); if (importWizardActionGroup.getWizardActionIds().length == 0) { aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, importAction); return; } IMenuManager submenu = new MenuManager( WorkbenchNavigatorMessages.PortingActionProvider_ImportResourcesMenu_label, COMMON_NAVIGATOR_IMPORT_MENU); importWizardActionGroup.fillContextMenu(submenu); submenu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS)); submenu.add(new Separator()); submenu.add(importAction); aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, submenu); }
Example #10
Source File: RootActionProvider.java From codewind-eclipse with Eclipse Public License 2.0 | 6 votes |
@Override public void fillActionBars(IActionBars actionBars) { super.fillActionBars(actionBars); actionBars.setGlobalActionHandler(OpenAppAction.ACTION_ID, openAppAction); actionBars.setGlobalActionHandler(RestartRunModeAction.ACTION_ID, restartRunAction); actionBars.setGlobalActionHandler(RestartDebugModeAction.ACTION_ID, restartDebugAction); IContributionManager cm = actionBars.getToolBarManager(); IContributionItem[] items = cm.getItems(); List<IAction> existingActions = new ArrayList<IAction>(); for (IContributionItem item : items) { if (item instanceof ActionContributionItem) { existingActions.add(((ActionContributionItem)item).getAction()); } } if (!existingActions.contains(openAppAction)) { cm.appendToGroup(ICommonMenuConstants.GROUP_OPEN, openAppAction); } if (!existingActions.contains(restartRunAction)) { cm.appendToGroup(ICommonMenuConstants.GROUP_OPEN, restartRunAction); } if (!existingActions.contains(restartDebugAction)) { cm.appendToGroup(ICommonMenuConstants.GROUP_OPEN, restartDebugAction); } }
Example #11
Source File: CallHierarchyViewPart.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
protected void fillCallHierarchyViewerContextMenu(IMenuManager menu) { JavaPlugin.createStandardGroups(menu); menu.appendToGroup(IContextMenuConstants.GROUP_SHOW, fRefreshSingleElementAction); menu.appendToGroup(IContextMenuConstants.GROUP_SHOW, new Separator(GROUP_FOCUS)); if (fFocusOnSelectionAction.canActionBeAdded()) { menu.appendToGroup(GROUP_FOCUS, fFocusOnSelectionAction); } if (fExpandWithConstructorsAction.canActionBeAdded()) { menu.appendToGroup(GROUP_FOCUS, fExpandWithConstructorsAction); } if (fRemoveFromViewAction.canActionBeAdded()){ menu.appendToGroup(GROUP_FOCUS, fRemoveFromViewAction); } fActionGroups.setContext(new ActionContext(getSelection())); fActionGroups.fillContextMenu(menu); fActionGroups.setContext(null); if (fCopyAction.canActionBeAdded()) { menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, fCopyAction); } }
Example #12
Source File: JavaPlugin.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
/** * Creates the Java plug-in's standard groups for view context menus. * * @param menu the menu manager to be populated */ public static void createStandardGroups(IMenuManager menu) { if (!menu.isEmpty()) return; menu.add(new Separator(IContextMenuConstants.GROUP_NEW)); menu.add(new GroupMarker(IContextMenuConstants.GROUP_GOTO)); menu.add(new Separator(IContextMenuConstants.GROUP_OPEN)); menu.add(new GroupMarker(IContextMenuConstants.GROUP_SHOW)); menu.add(new Separator(ICommonMenuConstants.GROUP_EDIT)); menu.add(new Separator(IContextMenuConstants.GROUP_REORGANIZE)); menu.add(new Separator(IContextMenuConstants.GROUP_GENERATE)); menu.add(new Separator(IContextMenuConstants.GROUP_SEARCH)); menu.add(new Separator(IContextMenuConstants.GROUP_BUILD)); menu.add(new Separator(IContextMenuConstants.GROUP_ADDITIONS)); menu.add(new Separator(IContextMenuConstants.GROUP_VIEWER_SETUP)); menu.add(new Separator(IContextMenuConstants.GROUP_PROPERTIES)); }
Example #13
Source File: PropertiesActionProvider.java From translationstudio8 with GNU General Public License v2.0 | 5 votes |
public void fillContextMenu(IMenuManager menu) { super.fillContextMenu(menu); if (propertiesAction.isApplicableForSelection()) { menu.appendToGroup(ICommonMenuConstants.GROUP_PROPERTIES, propertiesAction); } }
Example #14
Source File: CCPActionGroup.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
@Override public void fillContextMenu(IMenuManager menu) { super.fillContextMenu(menu); for (int i= 0; i < fActions.length; i++) { SelectionDispatchAction action= fActions[i]; if (action == fCutAction && !fCutAction.isEnabled()) continue; menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, action); } }
Example #15
Source File: GoNavigatorActionProvider.java From goclipse with Eclipse Public License 1.0 | 5 votes |
@Override public void fillContextMenu(IMenuManager menu) { super.fillContextMenu(menu); if(navigatorOpenAction.isEnabled()) { menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, navigatorOpenAction); } }
Example #16
Source File: OpenActionProvider.java From translationstudio8 with GNU General Public License v2.0 | 5 votes |
public void fillContextMenu(IMenuManager aMenu) { if (!contribute || getContext().getSelection().isEmpty()) { return; } IStructuredSelection selection = (IStructuredSelection) getContext().getSelection(); openFileAction.selectionChanged(selection); if (openFileAction.isEnabled()) { aMenu.insertAfter(ICommonMenuConstants.GROUP_OPEN, openFileAction); } // addOpenWithMenu(aMenu); }
Example #17
Source File: LangEditorContextMenuContributor.java From goclipse with Eclipse Public License 1.0 | 5 votes |
public void editorContextMenuAboutToShow(IMenuManager ctxMenu) { ctxMenu.prependToGroup(ICommonMenuConstants.GROUP_OPEN, new CommandContributionItem( createCommandContrib_OpenDefinitionContrib())); ctxMenu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, new CommandContributionItem( createCommandContrib_QuickOutline())); prepareSourceMenu(ctxMenu); }
Example #18
Source File: OpenActionProvider.java From gama with GNU General Public License v3.0 | 5 votes |
private void addOpenWithMenu(final IMenuManager aMenu) { final IStructuredSelection ss = (IStructuredSelection) getContext().getSelection(); if (ss == null || ss.size() != 1) { return; } final Object o = ss.getFirstElement(); // first try IResource IAdaptable openable = CloseResourceAction.getAdapter(o, IResource.class); // otherwise try ResourceMapping if (openable == null) { openable = CloseResourceAction.getAdapter(o, ResourceMapping.class); } else if (((IResource) openable).getType() != IResource.FILE) { openable = null; } if (openable != null) { // Create a menu flyout. final IMenuManager submenu = new MenuManager(WorkbenchNavigatorMessages.OpenActionProvider_OpenWithMenu_label, ICommonMenuConstants.GROUP_OPEN_WITH); submenu.add(new GroupMarker(ICommonMenuConstants.GROUP_TOP)); submenu.add(new OpenWithMenu(viewSite.getPage(), openable)); submenu.add(new GroupMarker(ICommonMenuConstants.GROUP_ADDITIONS)); // Add the submenu. if (submenu.getItems().length > 2 && submenu.isEnabled()) { aMenu.appendToGroup(ICommonMenuConstants.GROUP_OPEN_WITH, submenu); } } }
Example #19
Source File: OpenActionProvider.java From gama with GNU General Public License v3.0 | 5 votes |
@Override public void fillContextMenu(final IMenuManager aMenu) { if (!contribute || getContext().getSelection().isEmpty()) { return; } final IStructuredSelection selection = (IStructuredSelection) getContext().getSelection(); openFileAction.selectionChanged(selection); if (openFileAction.isEnabled()) { aMenu.insertAfter(ICommonMenuConstants.GROUP_OPEN, openFileAction); } addOpenWithMenu(aMenu); }
Example #20
Source File: PropertiesActionProvider.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
public void fillContextMenu(IMenuManager menu) { super.fillContextMenu(menu); if (propertiesAction.isApplicableForSelection()) { menu.appendToGroup(ICommonMenuConstants.GROUP_PROPERTIES, propertiesAction); } }
Example #21
Source File: TmfActionProvider.java From tracecompass with Eclipse Public License 2.0 | 5 votes |
@Override public void fillContextMenu(IMenuManager menu) { ISelection selection = getContext().getSelection(); if (selection instanceof IStructuredSelection) { IStructuredSelection structuredSelection = (IStructuredSelection) selection; if (structuredSelection.size() == 1 && structuredSelection.getFirstElement() instanceof TmfTraceElement) { TmfTraceElement traceElement = (TmfTraceElement) structuredSelection.getFirstElement(); if (traceElement.getResource() instanceof IFile) { MenuManager openWithMenu = new MenuManager(Messages.TmfActionProvider_OpenWith); openWithMenu.add(new OpenWithMenu(page, traceElement.getResource())); menu.insertAfter(ICommonMenuConstants.GROUP_OPEN_WITH, openWithMenu); } } } }
Example #22
Source File: OpenActionProvider.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
public void fillContextMenu(IMenuManager aMenu) { if (!contribute || getContext().getSelection().isEmpty()) { return; } IStructuredSelection selection = (IStructuredSelection) getContext().getSelection(); openFileAction.selectionChanged(selection); if (openFileAction.isEnabled()) { aMenu.insertAfter(ICommonMenuConstants.GROUP_OPEN, openFileAction); } // addOpenWithMenu(aMenu); }
Example #23
Source File: BugActionProvider.java From spotbugs with GNU Lesser General Public License v2.1 | 5 votes |
@Override public void fillContextMenu(IMenuManager menu) { super.fillContextMenu(menu); menu.insertBefore(ICommonMenuConstants.GROUP_PORT, new Separator("fb")); menu.insertBefore(ICommonMenuConstants.GROUP_PORT, new Separator("fb.project")); menu.insertBefore(ICommonMenuConstants.GROUP_PORT, new Separator("fb.filter")); }
Example #24
Source File: AbstractContentOutlinePage.java From goclipse with Eclipse Public License 1.0 | 4 votes |
protected void contextMenuAboutToShow(IMenuManager menu) { if(menu.isEmpty()) { menu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS)); } }
Example #25
Source File: ActionProvider.java From hadoop-gpu with Apache License 2.0 | 4 votes |
@Override public void fillContextMenu(IMenuManager menu) { /* * Actions on multiple selections */ menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, new DFSAction( DFSActions.DELETE)); menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, new DFSAction( DFSActions.REFRESH)); menu.appendToGroup(ICommonMenuConstants.GROUP_NEW, new DFSAction( DFSActions.DOWNLOAD)); if (site == null) return; ISelection isel = site.getStructuredViewer().getSelection(); if (!(isel instanceof IStructuredSelection)) return; /* * Actions on single selections only */ IStructuredSelection issel = (IStructuredSelection) isel; if (issel.size() != 1) return; Object element = issel.getFirstElement(); if (element instanceof DFSFile) { menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, new DFSAction( DFSActions.OPEN)); } else if (element instanceof DFSFolder) { menu.appendToGroup(ICommonMenuConstants.GROUP_NEW, new DFSAction( DFSActions.MKDIR)); menu.appendToGroup(ICommonMenuConstants.GROUP_NEW, new DFSAction( DFSActions.UPLOAD_FILES)); menu.appendToGroup(ICommonMenuConstants.GROUP_NEW, new DFSAction( DFSActions.UPLOAD_DIR)); } else if (element instanceof DFSLocation) { menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, new DFSAction( DFSActions.RECONNECT)); } else if (element instanceof DFSLocationsRoot) { menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, new DFSAction( DFSActions.DISCONNECT)); } }
Example #26
Source File: PythonRefactorActionProvider.java From Pydev with Eclipse Public License 1.0 | 4 votes |
@Override public void fillContextMenu(IMenuManager menu) { if (renameResourceAction.isEnabled()) { menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, renameResourceAction); } }
Example #27
Source File: ActionProvider.java From RDFS with Apache License 2.0 | 4 votes |
@Override public void fillContextMenu(IMenuManager menu) { /* * Actions on multiple selections */ menu.appendToGroup(ICommonMenuConstants.GROUP_EDIT, new DFSAction( DFSActions.DELETE)); menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, new DFSAction( DFSActions.REFRESH)); menu.appendToGroup(ICommonMenuConstants.GROUP_NEW, new DFSAction( DFSActions.DOWNLOAD)); if (site == null) return; ISelection isel = site.getStructuredViewer().getSelection(); if (!(isel instanceof IStructuredSelection)) return; /* * Actions on single selections only */ IStructuredSelection issel = (IStructuredSelection) isel; if (issel.size() != 1) return; Object element = issel.getFirstElement(); if (element instanceof DFSFile) { menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, new DFSAction( DFSActions.OPEN)); } else if (element instanceof DFSFolder) { menu.appendToGroup(ICommonMenuConstants.GROUP_NEW, new DFSAction( DFSActions.MKDIR)); menu.appendToGroup(ICommonMenuConstants.GROUP_NEW, new DFSAction( DFSActions.UPLOAD_FILES)); menu.appendToGroup(ICommonMenuConstants.GROUP_NEW, new DFSAction( DFSActions.UPLOAD_DIR)); } else if (element instanceof DFSLocation) { menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, new DFSAction( DFSActions.RECONNECT)); } else if (element instanceof DFSLocationsRoot) { menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, new DFSAction( DFSActions.DISCONNECT)); } }
Example #28
Source File: PortingActionProvider.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
private void addSimplePortingMenus(IMenuManager aMenu) { aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, importAction); aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, exportAction); }
Example #29
Source File: PortingActionProvider.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
private void addSimplePortingMenus(IMenuManager aMenu) { aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, importAction); aMenu.appendToGroup(ICommonMenuConstants.GROUP_PORT, exportAction); }
Example #30
Source File: LangNavigatorActionProvider.java From goclipse with Eclipse Public License 1.0 | 3 votes |
@Override public void fillContextMenu(IMenuManager menu) { IProject project = getBundleProjectFromSelection(); if(project == null) return; MenuManager bundleOpsMenu = new MenuManager(getMenuName(), LangImages.NAV_Library, "bundleMenu"); initActions(bundleOpsMenu, project); menu.prependToGroup(ICommonMenuConstants.GROUP_BUILD, bundleOpsMenu); }