/**
   * This inserts global actions before the "additions-end" separator.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated
   */
  protected void addGlobalActions(IMenuManager menuManager) {
    menuManager.insertAfter("additions-end", new Separator("ui-actions"));
    menuManager.insertAfter("ui-actions", showPropertiesViewAction);

    refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
    menuManager.insertAfter("ui-actions", refreshViewerAction);

    super.addGlobalActions(menuManager);
  }
  /*
   * @see org.eclipse.ui.part.EditorActionBarContributor#contributeToMenu(org.eclipse.jface.action.IMenuManager)
   */
  @Override
  public void contributeToMenu(IMenuManager menu) {

    super.contributeToMenu(menu);

    IMenuManager editMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
    if (editMenu != null) {

      MenuManager structureSelection =
          new MenuManager(
              JavaEditorMessages.ExpandSelectionMenu_label, "expandSelection"); // $NON-NLS-1$
      editMenu.insertAfter(ITextEditorActionConstants.SELECT_ALL, structureSelection);
      structureSelection.add(fStructureSelectEnclosingAction);
      structureSelection.add(fStructureSelectNextAction);
      structureSelection.add(fStructureSelectPreviousAction);
      structureSelection.add(fStructureSelectHistoryAction);

      editMenu.appendToGroup(
          ITextEditorActionConstants.GROUP_INFORMATION, fRetargetShowInformationAction);
    }

    IMenuManager navigateMenu = menu.findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE);
    if (navigateMenu != null) {
      navigateMenu.appendToGroup(IWorkbenchActionConstants.SHOW_EXT, fShowOutline);
      navigateMenu.appendToGroup(IWorkbenchActionConstants.SHOW_EXT, fOpenHierarchy);
    }

    IMenuManager gotoMenu = menu.findMenuUsingPath("navigate/goTo"); // $NON-NLS-1$
    if (gotoMenu != null) {
      gotoMenu.add(new Separator("additions2")); // $NON-NLS-1$
      gotoMenu.appendToGroup("additions2", fGotoPreviousMemberAction); // $NON-NLS-1$
      gotoMenu.appendToGroup("additions2", fGotoNextMemberAction); // $NON-NLS-1$
      gotoMenu.appendToGroup("additions2", fGotoMatchingBracket); // $NON-NLS-1$
    }
  }
  /**
   * This adds to the menu bar a menu and some separators for editor additions, as well as the
   * sub-menus for object creation items.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated
   */
  @Override
  public void contributeToMenu(IMenuManager menuManager) {
    super.contributeToMenu(menuManager);

    IMenuManager submenuManager =
        new MenuManager(DsmlEditorPlugin.INSTANCE.getString("_UI_DsmlEditor_menu"), "dsmlMenuID");
    menuManager.insertAfter("additions", submenuManager);
    submenuManager.add(new Separator("settings"));
    submenuManager.add(new Separator("actions"));
    submenuManager.add(new Separator("additions"));
    submenuManager.add(new Separator("additions-end"));

    // Prepare for CreateChild item addition or removal.
    //
    createChildMenuManager =
        new MenuManager(DsmlEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
    submenuManager.insertBefore("additions", createChildMenuManager);

    // Prepare for CreateSibling item addition or removal.
    //
    createSiblingMenuManager =
        new MenuManager(DsmlEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
    submenuManager.insertBefore("additions", createSiblingMenuManager);

    // Force an update because Eclipse hides empty menus now.
    //
    submenuManager.addMenuListener(
        new IMenuListener() {
          public void menuAboutToShow(IMenuManager menuManager) {
            menuManager.updateAll(true);
          }
        });

    addGlobalActions(submenuManager);
  }
  @Override
  public void contributeToMenu(IMenuManager menuManager) {
    super.contributeToMenu(menuManager);

    MenuManager sourceMenu = new MenuManager("Source");
    menuManager.insertAfter(IWorkbenchActionConstants.MB_ADDITIONS, sourceMenu);
    sourceMenu.add(this.commentAction);
    sourceMenu.add(this.uncommentAction);
    sourceMenu.add(this.toggleCommentsAction);
  }
Example #5
0
  public void fillContextMenu(IMenuManager menu) {
    if (!contribute || getContext().getSelection().isEmpty()) {
      return;
    }
    IStructuredSelection selection = (IStructuredSelection) getContext().getSelection();

    if (selection.size() == 1) {
      Object selObj = selection.getFirstElement();
      if (selObj instanceof IClassFile) {
        openIRFileAction.setClassFile((IClassFile) selObj);
        menu.insertAfter(ICommonMenuConstants.GROUP_OPEN, openIRFileAction);
      }
    } else {
      openFileAction.selectionChanged(selection);
      if (openFileAction.isEnabled())
        menu.insertAfter(ICommonMenuConstants.GROUP_OPEN, openFileAction);
    }
    addOpenWithMenu(selection, menu);
  }
 public void menuAboutToShow(IMenuManager manager) {
   IContributionItem[] items = manager.getItems();
   // add configuration's menu items
   IMenuListener listener = getConfiguration().getMenuListener(getTreeViewer());
   if (listener != null) {
     listener.menuAboutToShow(manager);
     manager.add(new Separator());
   }
   if (items.length > 0 && items[items.length - 1].getId() != null) {
     manager.insertAfter(
         items[items.length - 1].getId(),
         new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
   } else {
     manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
   }
 }
  @Override
  protected IMenuManager contributeToEditMenu(IMenuManager menuManager) {
    IMenuManager editMenu = super.contributeToEditMenu(menuManager);

    // Text Positions
    IMenuManager textPositionMenu = new MenuManager(Messages.CanvasEditorActionBarContributor_0);
    for (String id : TextPositionAction.ACTION_IDS) {
      textPositionMenu.add(getAction(id));
    }
    editMenu.appendToGroup(GROUP_EDIT_MENU, textPositionMenu);

    // Border Color
    editMenu.appendToGroup(GROUP_EDIT_MENU, getAction(BorderColorAction.ID));

    // Lock
    editMenu.insertAfter(
        ArchimateEditorActionFactory.RENAME.getId(), new Separator("lock")); // $NON-NLS-1$
    editMenu.appendToGroup("lock", getAction(LockObjectAction.ID)); // $NON-NLS-1$

    return editMenu;
  }
Example #8
0
  @Override
  public void fillContextMenu(IMenuManager menu) {
    if (viewer == null) {
      return;
    }

    CDOCheckout checkout = CDOExplorerUtil.getCheckout(selectedObject);
    if (checkout == null || checkout.isReadOnly()) {
      return;
    }

    IMenuManager submenu = new MenuManager("&New", NEW_MENU_NAME);

    fillNewWizardActions(submenu);

    if (selectedObject instanceof CDOResource) {
      CDOResource resource = (CDOResource) selectedObject;
      if (!resource.isRoot()) {
        fillNewRootActions(submenu, checkout, resource);

        submenu.add(new Separator());
        submenu.add(new NewRootOtherAction(resource, checkout));
        submenu.add(new Separator());
      }
    } else if (selectedObject instanceof CDOResourceNode) {
      // Do nothing. CDOResourceFolder contributions have already been added by
      // newWizardActionGroup.
    } else if (selectedObject instanceof EObject) {
      fillNewChildActions(submenu, checkout, (EObject) selectedObject);
    }

    submenu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS));

    // Append the submenu after the GROUP_NEW group.
    menu.insertAfter(ICommonMenuConstants.GROUP_NEW, submenu);
  }
  /**
   * This adds to the menu bar a menu and some separators for editor additions, as well as the
   * sub-menus for object creation items.
   * <!--
   * begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @param menuManager the menu manager
   * @generated_not
   */
  @Override
  public void contributeToMenu(IMenuManager menuManager) {
    super.contributeToMenu(menuManager);

    IMenuManager submenuManager =
        new MenuManager(
            DsEditorPlugin.INSTANCE.getString("_UI_DsEditor_menu"),
            "org.wso2.carbonstudio.eclipse.dsMenuID");
    menuManager.insertAfter("additions", submenuManager);
    submenuManager.add(new Separator("settings"));
    submenuManager.add(new Separator("actions"));
    submenuManager.add(new Separator("additions"));
    submenuManager.add(new Separator("additions-end"));

    // Prepare for item addition or removal.

    if (generateDataSourceMenu) {
      submenuManager.insertBefore("additions", dsMenuManager);
    }

    if (generateQueryAndOperationAndResourceMenu) {
      submenuManager.insertBefore("additions", configPropertyAction);
      submenuManager.insertBefore("additions", queryAction);
      submenuManager.insertBefore("additions", operationAction);
      submenuManager.insertBefore("additions", resourceAction);
    }

    if (generateQueryChildrenMenu) {
      submenuManager.insertBefore("additions", resultAction);
      submenuManager.insertBefore("additions", inputParamAction);
      submenuManager.insertBefore("additions", eventTriggerAction);
      submenuManager.insertBefore("additions", queryPropertyGroupAction);
    }

    if (generateSubscriptionMenu) {
      submenuManager.insertBefore("additions", subscriptionAction);
    }

    if (generateCallQueryInputMappingMenu) {
      submenuManager.insertBefore("additions", callQueryInputMappingAction);
    }

    if (generateOutputMappingMenu) {
      submenuManager.insertBefore("additions", outputMappingsMenuManager);
    }

    if (generateCallQueryMenu) {
      submenuManager.insertBefore("additions", callQueryAction);
    }

    if (generateValidatorMenu) {
      submenuManager.insertBefore("additions", validatorMenuManager);
    }

    if (generateQueryPropertyListMenu) {
      submenuManager.insertBefore("additions", queryPropertyAction);
    }

    // Force an update because Eclipse hides empty menus now.

    submenuManager.addMenuListener(
        new IMenuListener() {
          public void menuAboutToShow(IMenuManager menuManager) {
            menuManager.updateAll(true);
          }
        });

    addGlobalActions(submenuManager);
  }