void fillContextMenu(IMenuManager manager) {
    addFocusActionOrNot(manager);
    manager.add(fResetAction);
    manager.add(fRefreshAction);
    manager.add(new Separator());

    if (!getSite().getSelectionProvider().getSelection().isEmpty()) {
      MenuManager showInSubMenu = new MenuManager(getShowInMenuLabel());
      IWorkbenchWindow workbenchWindow = getSite().getWorkbenchWindow();
      showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(workbenchWindow));
      manager.add(showInSubMenu);
    }
    addElementActionsOrNot(manager);
    manager.add(new Separator());

    manager.add(fCopyAction);
    manager.add(new Separator());

    fDrillDownAdapter.addNavigationActions(manager);
    manager.add(new Separator());
    // Other plug-ins can contribute there actions here
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    manager.add(new Separator());
    addCompareActionOrNot(manager);
    manager.add(fPropertiesAction);
  }
  /* (non-Javadoc)
   * Method declared in ActionGroup
   */
  @Override
  public void fillContextMenu(IMenuManager menu) {
    super.fillContextMenu(menu);
    if (!fIsTypeHiararchyViewerOwner) appendToGroup(menu, fOpenTypeHierarchy);
    if (!fIsCallHiararchyViewerOwner) appendToGroup(menu, fOpenCallHierarchy);

    if (fShowShowInMenu) {
      MenuManager showInSubMenu = new MenuManager(getShowInMenuLabel());
      IWorkbenchWindow workbenchWindow = fOpenSuperImplementation.getSite().getWorkbenchWindow();
      showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(workbenchWindow));
      menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, showInSubMenu);
    }

    IStructuredSelection selection = getStructuredSelection();
    if (fShowOpenPropertiesAction
        && selection != null
        && fOpenPropertiesDialog.isApplicableForSelection())
      menu.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, fOpenPropertiesDialog);
  }
Example #3
0
 /**
  * @param workbenchWindow the workbench window to use for creating the show in menu.
  * @return the show in menu
  */
 public static MenuManager createShowInMenu(IWorkbenchWindow workbenchWindow) {
   MenuManager showInSubMenu = new MenuManager(getShowInMenuLabel());
   showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(workbenchWindow));
   return showInSubMenu;
 }