Package org.eclipse.jface.action

Examples of org.eclipse.jface.action.IMenuManager


   * @since 3.3
   */
  public void contributeToMenu(IMenuManager menu) {
    super.contributeToMenu(menu);
   
    IMenuManager editMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
    if (editMenu != null) {
      editMenu.appendToGroup(ITextEditorActionConstants.GROUP_ASSIST, fQuickAssistMenuEntry);
      fQuickAssistMenuEntry.setVisible(false);
      editMenu.appendToGroup(ITextEditorActionConstants.GROUP_INFORMATION, fRetargetShowInformationAction);
    }
  }
View Full Code Here


   * @see EditorActionBarContributor#init(org.eclipse.ui.IActionBars)
   */
  public void init(IActionBars bars) {
    super.init(bars);

    IMenuManager menuManager= bars.getMenuManager();
    IMenuManager editMenu= menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
    if (editMenu != null)
      editMenu.add(fChangeEncodingAction);
  }}
View Full Code Here

  /*
   * @see EditorActionBarContributor#contributeToMenu(IMenuManager)
   */
  public void contributeToMenu(IMenuManager menu) {

    IMenuManager editMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
    if (editMenu != null) {
      editMenu.prependToGroup(IWorkbenchActionConstants.FIND_EXT, fIncrementalFindReverse);
      editMenu.prependToGroup(IWorkbenchActionConstants.FIND_EXT, fIncrementalFind);
      editMenu.prependToGroup(IWorkbenchActionConstants.FIND_EXT, fFindPrevious);
      editMenu.prependToGroup(IWorkbenchActionConstants.FIND_EXT, fFindNext);

      addOrInsert(editMenu, new Separator(ITextEditorActionConstants.GROUP_OPEN));
      addOrInsert(editMenu, new Separator(ITextEditorActionConstants.GROUP_INFORMATION));
      addOrInsert(editMenu, new Separator(ITextEditorActionConstants.GROUP_ASSIST));
      addOrInsert(editMenu, new Separator(ITextEditorActionConstants.GROUP_GENERATE));
      addOrInsert(editMenu, new Separator(IWorkbenchActionConstants.MB_ADDITIONS));

      editMenu.appendToGroup(ITextEditorActionConstants.GROUP_ASSIST, fHippieCompletion);
    }

    IMenuManager navigateMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_NAVIGATE);
    if (navigateMenu != null) {
      navigateMenu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fGotoLine);
    }
  }
View Full Code Here

     IAction action= getAction(actionId);
     if (action != null) {
       if (action instanceof IUpdate)
         ((IUpdate) action).update();

       IMenuManager subMenu= menu.findMenuUsingPath(group);
       if (subMenu != null)
         subMenu.add(action);
       else
         menu.appendToGroup(group, action);
     }
  }
View Full Code Here

   * @param menu the menu to add the new group to
   * @param existingGroup the group after which to insert the new group
   * @param newGroup the new group
   */
  protected final void addGroup(IMenuManager menu, String existingGroup, String newGroup) {
     IMenuManager subMenu= menu.findMenuUsingPath(existingGroup);
     if (subMenu != null)
       subMenu.add(new Separator(newGroup));
     else
       menu.appendToGroup(existingGroup, new Separator(newGroup));
  }
View Full Code Here

                openAction.selectionChanged(selection);
                menu.appendToGroup(IContextMenuConstants.GROUP_OPEN,
                        openAction);

                // Create menu
                IMenuManager submenu = new MenuManager(SearchMessages.
                        getString(RESOURCE_PREFIX + "openWith.label"));
                submenu.add(new OpenWithMenu(workbenchPage, (IAdaptable) o));

                // Add the submenu.
                menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, submenu);
            }
        }
View Full Code Here

  }
 
  public void init(IActionBars bars) {
    super.init(bars);
   
    IMenuManager menuManager = bars.getMenuManager();
    IMenuManager editMenu = menuManager.findMenuUsingPath("edit");
   
    if (editMenu != null) {
      editMenu.insertBefore("additions", new Separator("amateras"));
      for(int i=0;i<actionIds.size();i++){
        RetargetTextEditorAction action = new RetargetTextEditorAction(HTMLPlugin.getDefault().getResourceBundle(), null);
        this.actions.add(action);
        editMenu.appendToGroup("amateras",action);
      }
    }
  }
View Full Code Here

    runJCasGenAction.setText("Run JCasGen");
  }

  public void contributeToMenu(IMenuManager manager) {

    IMenuManager menu = new MenuManager("&UIMA"); //$NON-NLS-1$
    manager.prependToGroup(IWorkbenchActionConstants.MB_ADDITIONS, menu);
    menu.add(runJCasGenAction);
    IMenuManager settingsMenu = new MenuManager("Settings"); //$NON-NLS-1$
    menu.add(settingsMenu);
    settingsMenu.add(autoJCasAction);
    settingsMenu.add(qualifiedTypesAction);
  }
View Full Code Here

    actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), new SelectAllAction());
   
    Action action = new SwitchStyleAction(this);
   
    IMenuManager dropDownMenu = actionBars.getMenuManager();
    dropDownMenu.add(action);
   
    super.setActionBars(actionBars);
  }
View Full Code Here

     * <li>a generic "Other" new wizard shortcut action</li>
     * </ul>
     */
    @Override
    public void fillContextMenu(IMenuManager menu) {
        IMenuManager submenu = new MenuManager(
                Messages.ToolNewActionProvider_popupNewLabel,
                NEW_MENU_NAME);
        if(!contribute) {
            return;
        }

        // fill the menu from the commonWizard contributions
        newWizardActionGroup.setContext(getContext());
        newWizardActionGroup.fillContextMenu(submenu);

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

        // Add other ..
        submenu.add(new Separator());
        submenu.add(showDlgAction);

        // append the submenu after the GROUP_NEW group.
        menu.insertAfter(ICommonMenuConstants.GROUP_NEW, submenu);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.action.IMenuManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.