/* (non-Javadoc) * @see org.eclipse.jface.action.IMenuListener#menuAboutToShow(org.eclipse.jface.action.IMenuManager) */ public void menuAboutToShow(IMenuManager menu) { JavaPlugin.createStandardGroups(menu); IStructuredSelection selection = (IStructuredSelection) fViewer.getSelection(); int size = selection.size(); Object element = selection.getFirstElement(); if (size == 1) addOpenNewWindowAction(menu, element); fActionGroups.setContext(new ActionContext(selection)); fActionGroups.fillContextMenu(menu); fActionGroups.setContext(null); }
protected void fillActionBars(IActionBars actionBars) { IToolBarManager toolBar = actionBars.getToolBarManager(); fillToolBar(toolBar); if (fHasWorkingSetFilter) fWorkingSetFilterActionGroup.fillActionBars(getViewSite().getActionBars()); actionBars.updateActionBars(); fActionGroups.fillActionBars(actionBars); if (fHasCustomFilter) fCustomFiltersActionGroup.fillActionBars(actionBars); IMenuManager menu = actionBars.getMenuManager(); menu.add(fToggleLinkingAction); }
@Override public void dispose() { if (fViewer != null) { getViewSite().getPage().removePostSelectionListener(this); getViewSite().getPage().removePartListener(fPartListener); fViewer = null; } if (fActionGroups != null) { fActionGroups.dispose(); fActionGroups = null; } if (fWorkingSetFilterActionGroup != null) { fWorkingSetFilterActionGroup.dispose(); fWorkingSetFilterActionGroup = null; } super.dispose(); }