Package org.eclipse.ui.menus

Examples of org.eclipse.ui.menus.CommandContributionItem


        String commandId, String menuLabel) {
      CommandContributionItemParameter parameter = new CommandContributionItemParameter(
          site, commandId, commandId,
          CommandContributionItem.STYLE_PUSH);
      parameter.label = menuLabel;
      return new CommandContributionItem(parameter);
    }
View Full Code Here


    this.editor = editor;
  }
 
  public void editorContextMenuAboutToShow(IMenuManager menu) {
    IWorkbenchWindow window = editor.getSite().getWorkbenchWindow();
    menu.prependToGroup(ICommonMenuConstants.GROUP_OPEN, new CommandContributionItem(
      new CommandContributionItemParameter(window,
        null,
        EditorSettings_Actual.COMMAND_OpenDef_ID,
        CommandContributionItem.STYLE_PUSH
      )
View Full Code Here

    return editorContribution;
  }
 
  protected CommandContributionItem createCommandContribution(String commandId) {
    IWorkbenchWindow svcLocator = getPage().getWorkbenchWindow();
    return new CommandContributionItem(
      new CommandContributionItemParameter(svcLocator, null, commandId, CommandContributionItem.STYLE_PUSH));
  }
View Full Code Here

      if (matcher.matches(actionContribution.getAction()))
        menu = new SWTBotViewMenu(actionContribution);
    } else if (item instanceof SubContributionItem ) {
          menu = getMenuItem(((SubContributionItem) item).getInnerItem(), matcher);
    } else if (item instanceof CommandContributionItem) {
      CommandContributionItem cmdContribution = (CommandContributionItem) item;
      if (matcher.matches(new CommandItemWithTextMatcherWrapper(cmdContribution)))
        menu = new SWTBotViewMenu(cmdContribution.getCommand());
    }
    return menu;
  }
View Full Code Here

    private void addCommand(MenuManager menuManager, List/* <IContributionItem> */items,
            String commandId) {
        CommandContributionItemParameter parm = new CommandContributionItemParameter(
                serviceLocator, null, commandId, CommandContributionItem.STYLE_PUSH);
        fillMenu(menuManager, items, new CommandContributionItem(parm));
    }
View Full Code Here

  protected CommandContributionItem createCommandContributionItemForEntry(String commandId, IRosterEntry rosterEntry) {
    CommandContributionItemParameter p = new CommandContributionItemParameter(serviceLocator, null, commandId, CommandContributionItem.STYLE_PUSH);
    p.icon = getRosterEntryImageDescriptor(rosterEntry);
    p.label = rosterEntry.getName();
    // 3.4 return new CommandContributionItem(serviceLocator, null, commandId, new HashMap(), getRosterEntryImageDescriptor(rosterEntry), null, null, rosterEntry.getName(), null, null, CommandContributionItem.STYLE_PUSH);
    return new CommandContributionItem(p);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.menus.CommandContributionItem

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.