protected void editorContextMenuAboutToShow(IMenuManager menu) { super.editorContextMenuAboutToShow(menu); IAction preferencesAction= getAction(ITextEditorActionConstants.CONTEXT_PREFERENCES); menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator(ITextEditorActionConstants.GROUP_SETTINGS)); menu.appendToGroup(ITextEditorActionConstants.GROUP_SETTINGS, preferencesAction); menu.appendToGroup(ITextEditorActionConstants.GROUP_SAVE, new Separator(ITextEditorActionConstants.GROUP_OPEN)); MenuManager showInSubMenu= new MenuManager(getShowInMenuLabel()); showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(getEditorSite().getWorkbenchWindow())); menu.appendToGroup(ITextEditorActionConstants.GROUP_OPEN, showInSubMenu); }
@Override protected void editorContextMenuAboutToShow(IMenuManager menu) { super.editorContextMenuAboutToShow(menu); IAction preferencesAction= getAction(ITextEditorActionConstants.CONTEXT_PREFERENCES); menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator(ITextEditorActionConstants.GROUP_SETTINGS)); menu.appendToGroup(ITextEditorActionConstants.GROUP_SETTINGS, preferencesAction); menu.appendToGroup(ITextEditorActionConstants.GROUP_SAVE, new Separator(ITextEditorActionConstants.GROUP_OPEN)); IEditorInput editorInput= getEditorInput(); if ((editorInput.getAdapter(IResource.class)) instanceof IFile) { MenuManager openWithSubMenu= new MenuManager(TextEditorMessages.AbstractDecoratedTextEditor_openWith_menu); final IWorkbenchPage page= getEditorSite().getPage(); // XXX: Internal reference will get fixed during 3.7, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=307026 openWithSubMenu.add(new OpenWithMenu(page, editorInput) { @Override protected void openEditor(IEditorDescriptor editorDescriptor, boolean openUsingDescriptor) { super.openEditor(editorDescriptor, openUsingDescriptor); ISelection selection= getSelectionProvider().getSelection(); if (selection instanceof ITextSelection) { revealInEditor(page.getActiveEditor(), ((ITextSelection)selection).getOffset(), ((ITextSelection)selection).getLength()); } } }); menu.appendToGroup(ITextEditorActionConstants.GROUP_OPEN, openWithSubMenu); } MenuManager showInSubMenu= new MenuManager(getShowInMenuLabel()); showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(getEditorSite().getWorkbenchWindow())); menu.appendToGroup(ITextEditorActionConstants.GROUP_OPEN, showInSubMenu); }
@Override protected void editorContextMenuAboutToShow(IMenuManager menu) { super.editorContextMenuAboutToShow(menu);