/* (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);
  }
Пример #2
0
  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);
  }
Пример #3
0
  @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();
  }