Package org.eclipse.ui.menus

Examples of org.eclipse.ui.menus.CommandContributionItem


  @Override
  protected void editorContextMenuAboutToShow(IMenuManager menu) {
    super.editorContextMenuAboutToShow(menu);
   
    menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, new CommandContributionItem(new CommandContributionItemParameter(getSite(), null, ToggleComment.ID, null, null, null, null, "Toggle comment", null, null, CommandContributionItem.STYLE_PUSH, null, true)));   
    menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, new CommandContributionItem(new CommandContributionItemParameter(getSite(), null, CreateLabel.ID, null, null, null, null, "Create label", null, null, CommandContributionItem.STYLE_PUSH, null, true)));
    menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, new SurroundWithAction());
    menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, new CommandContributionItem(new CommandContributionItemParameter(getSite(), null, DisplayHelp.ID, null, null, null, null, "Display help", null, null, CommandContributionItem.STYLE_PUSH, null, true)));
  }
View Full Code Here


  }

  @Override
  protected void editorContextMenuAboutToShow(IMenuManager menu) {
    super.editorContextMenuAboutToShow(menu);
    menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, new CommandContributionItem(new CommandContributionItemParameter(getSite(), null, ToggleComment.ID, null, null, null, null, "Toggle comment", null, null, CommandContributionItem.STYLE_PUSH, null, true)));
    menu.appendToGroup(ITextEditorActionConstants.GROUP_EDIT, new SurroundWithAction());
  }
View Full Code Here

    CommandContributionItemParameter p = new CommandContributionItemParameter(
        serviceLocator, "", command.getId(), CommandContributionItem.STYLE_PUSH);
   
    p.label = item.getName();
   
    CommandContributionItem contribItem = new CommandContributionItem(p);
    contribItem.setVisible(true);
    return contribItem;
  }
View Full Code Here

            final CommandContributionItemParameter param = new CommandContributionItemParameter(
                    PlatformUI.getWorkbench(), null,
                    "org.erlide.wrangler.refactoring.empty",
                    CommandContributionItem.STYLE_PUSH);
            param.label = "<Empty>";
            final CommandContributionItem item = new CommandContributionItem(param);
            return new IContributionItem[] { item };
        }
        final IContributionItem[] items = new IContributionItem[refacs.size()];

        int i = 0;
        for (final UserRefactoringInfo info : refacs) {
            final CommandContributionItemParameter param = new CommandContributionItemParameter(
                    PlatformUI.getWorkbench(), info.getCallback(),
                    "org.erlide.wrangler.refactoring.gen_refac",
                    CommandContributionItem.STYLE_PUSH);
            param.label = info.getLabel();
            param.parameters = new HashMap();
            param.parameters.put("org.erlide.wrangler.refactoring.gen_refac.callback",
                    info.getCallback());
            param.parameters.put("org.erlide.wrangler.refactoring.gen_refac.name",
                    info.getLabel());
            items[i] = new CommandContributionItem(param);
            i++;
        }

        return items;
    }
View Full Code Here

            param.parameters = new HashMap();
            param.parameters.put("org.erlide.wrangler.refactoring.gen_refac.callback",
                    info.getCallback());
            param.parameters.put("org.erlide.wrangler.refactoring.gen_refac.name",
                    info.getLabel());
            items[i] = new CommandContributionItem(param);
            i++;
        }

        return items;
    }
View Full Code Here

  protected IContributionItem[] getContributionItems() {
    List<MavenCommand> comamnds = loadPreferences();
    IContributionItem[] items = new IContributionItem[comamnds.size()];
    int i = 0;
    for (MavenCommand command : comamnds) {
      items[i] = new CommandContributionItem(
          getCommandContributionItemParameter(command));
      i++;
    }
    return items;
  }
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

    // This displays the name of the analysis and creates a checkbox
    // for it.
    int arr_index = 0;
    for( ICrystalAnalysis analysis : crystal.getAnalyses() ) {
      final String analysis_name = analysis.getName();
      final CommandContributionItem item =
        new CommandContributionItem(window,
                                    null,
                                    "CrystalPlugin.enableanalysis",
                                    Collections.singletonMap("CrystalPlugin.analysisname", analysis_name),
                                    null,null,null,
                                    analysis_name,
View Full Code Here

   * @param configurationElement
   * @return
   */
  private IContributionItem createCommandAdditionContribution(
      IServiceLocator locator, final IConfigurationElement commandAddition) {
    return new CommandContributionItem(locator, getId(commandAddition),
        getCommandId(commandAddition), getParameters(commandAddition),
        getIconDescriptor(commandAddition),
        getDisabledIconDescriptor(commandAddition),
        getHoverIconDescriptor(commandAddition),
        getLabel(commandAddition), getMnemonic(commandAddition),
View Full Code Here

      HashMap<String, String> mapd = new HashMap<String, String>();
      pd.label = "uima.tcas.Annotation";
      mapd.put(SetAnnotationModeHandler.TYPE, pd.label);
      pd.parameters =  mapd;
      pd.icon = RutaAddonsPlugin.getImageDescriptor("icons/font_add.png");
      CommandContributionItem itemp = new CommandContributionItem(pd);
      itemp.setVisible(true);
      additions.addContributionItem(itemp, null);
      for (String each : selectedTypes) {
        CommandContributionItemParameter p = new CommandContributionItemParameter(serviceLocator,
                "", SetAnnotationModeHandler.MODE, SWT.PUSH);
        p.label = each;
        p.icon = RutaAddonsPlugin.getImageDescriptor("icons/font_add.png");
        HashMap<String, String> map = new HashMap<String, String>();
        map.put(SetAnnotationModeHandler.TYPE, p.label);
        p.parameters =  map;
        CommandContributionItem item = new CommandContributionItem(p);
        item.setVisible(true);
        additions.addContributionItem(item, null);
      }
    } catch (PartInitException e) {
      RutaAddonsPlugin.error(e);
    }
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.