Package org.eclipse.ui.menus

Examples of org.eclipse.ui.menus.CommandContributionItemParameter


  @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

    command.define(item.getName(), "", commandService.getCategory("io.emmet.eclipse.commands.category"));
   
    IHandlerService handlerService = (IHandlerService) serviceLocator.getService(IHandlerService.class);
    handlerService.activateHandler(command.getId(), handlerFactory(item.getId()));
   
    CommandContributionItemParameter p = new CommandContributionItemParameter(
        serviceLocator, "", command.getId(), CommandContributionItem.STYLE_PUSH);
   
    p.label = item.getName();
   
    CommandContributionItem contribItem = new CommandContributionItem(p);
View Full Code Here

    @Override
    protected IContributionItem[] getContributionItems() {
        final List<UserRefactoringInfo> refacs = UserRefactoringsManager.getInstance()
                .getMyElementary();
        if (refacs.size() == 0) {
            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();
View Full Code Here

                .getElementary();
        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();
View Full Code Here

  private CommandContributionItemParameter getCommandContributionItemParameter(
      MavenCommand command) {
    Map<String, String> map = new HashMap<String, String>();
    map.put("commandLine", command.getCommandLine());

    CommandContributionItemParameter commandContributionItemParam = new CommandContributionItemParameter(
        Activator.getDefault().getWorkbench(),
        "org.eclipse.maven.commands.command."
            + command.getId(),
        "org.eclipse.maven.commands.command", map, null, null,
        null, command.getAliasValue(), null, null,
View Full Code Here

        return (IContributionItem[]) items.toArray(new IContributionItem[items.size()]);
    }

    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

    try {
      acView = (AnnotationCheckView) Workbench.getInstance().getActiveWorkbenchWindow()
              .getActivePage().showView(AnnotationCheckView.ID);
      AnnotationCheckComposite composite = (AnnotationCheckComposite) acView.getComposite();
      List<String> selectedTypes = composite.getSelectedTypes();
      CommandContributionItemParameter pd = new CommandContributionItemParameter(serviceLocator,
              "", SetAnnotationModeHandler.MODE, SWT.PUSH);
      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);
View Full Code Here

    try {
      acView = (AnnotationCheckView) Workbench.getInstance().getActiveWorkbenchWindow()
              .getActivePage().showView(AnnotationCheckView.ID);
      AnnotationCheckComposite composite = acView.getComposite();
      List<String> typesToCheck = new LinkedList<String>(composite.getCheckedTypes().keySet());
      CommandContributionItemParameter pd = new CommandContributionItemParameter(serviceLocator,
              "", SetAnnotationModeHandler.MODE, SWT.PUSH);
      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 : typesToCheck) {
        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);
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions)
    {
    CommandContributionItemParameter p=null;
    CommandContributionItem item=null;
    for(String config : ConnectorConfiguration.getConfigurationNames(Activator.getDefault().getStateLocation().toFile().getAbsolutePath()))
      {
      p = new CommandContributionItemParameter(serviceLocator, "",
        ConnectHandler.COMMAND_ID, SWT.PUSH);
      p.label = config;
      p.parameters=new HashMap<String, String>();
      p.parameters.put(ConnectHandler.COMMAND_PARAM_CONFIG_NAME, config);
     
View Full Code Here

TOP

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

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.