Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.Command


        {
          DestecsUIPlugin.log("Failed to upgrade project in action", e);
        }

        ICommandService cmdService = (ICommandService) HandlerUtil.getActiveSite(event).getService(ICommandService.class);
        Command upgradeCommand = cmdService.getCommand(IDestecsUiConstants.UPGRADE_LIBRARY_COMMANDID);
        if (upgradeCommand.isDefined())
        {
          try
          {
            upgradeCommand.executeWithChecks(event);
          } catch (Exception e)
          {
            DestecsUIPlugin.log("Could not execute library upgrade command", e);
          }
        }
View Full Code Here


  }

  @Override
  protected ICommandData createDataNode(
      LocalDate date, WorkspaceStorage ws, CommandEventType type) throws Exception {
    Command cmd = commandService().getCommand(type.getCommandId());
    return new CommandData(date, ws, cmd, type.getCount());
  }
View Full Code Here

  }

  private boolean isLinkedWithEditor() {
    ICommandService service = (ICommandService) PlatformUI.getWorkbench()
        .getService(ICommandService.class);
    Command command = service.getCommand("org.eclipse.wst.xml.ui.cmnd.contentmodel.sych"); //$NON-NLS-1$
    State state = command.getState("org.eclipse.ui.commands.toggleState"); //$NON-NLS-1$

    return ((Boolean) state.getValue()).booleanValue();
  }
View Full Code Here

  }
 
  @Override
  protected boolean isLeafMatch(Viewer viewer, Object element) {
    if (element instanceof Command) {
      Command cmd = (Command) element;
      try {
        return (wordMatches(cmd.getName())) || (wordMatches(cmd.getId()));
      } catch (NotDefinedException e) {
        return wordMatches(cmd.getId());
      }
    }
    return false;
  }
View Full Code Here

 
  @Override
  public int compare(Viewer viewer, Object e1, Object e2) {
    if ((e1 instanceof Command) && (e2 instanceof Command)) {
     
      Command cmd1 = (Command) e1;
      Command cmd2 = (Command) e2;
     
      if (!cmd1.isDefined()) {
        return 1;
      }
     
      if (!cmd2.isDefined()) {
        return -1;
      }
     
      try {
        return cmd1.getName().compareTo(cmd2.getName());
      } catch (NotDefinedException e) {
        return cmd1.getId().compareTo(cmd2.getId());
      }
     
    } else if ((e1 instanceof Category) && (e2 instanceof Category)) {
     
      Category cat1 = (Category) e1;
View Full Code Here

  protected String getMessage(Object treeNode) {
    if (treeNode instanceof Category) {
      return ((Category) treeNode).getId();
     
    } else if (treeNode instanceof Command) {
      Command cmd = (Command) treeNode;
      try {
        return cmd.getId() + "    " + cmd.getDescription();
      } catch (NotDefinedException e) {
        return cmd.getId();
      }
    }
    return super.getMessage(treeNode);
  }
View Full Code Here

  @Override
  public void shouldCorrectlyBuildMultiplePaths() {
    WorkspaceStorage ws2 = new WorkspaceStorage(new Path(".b"), null);
    LocalDate date2 = date.minusDays(2);
    Command command2 = newCommand("abc");
    int count2 = count + 10;

    ICategory[] categories = {Category.WORKSPACE, Category.COMMAND};
    List<TreePath> expected = asList(
        newPath(ws, command, count),
View Full Code Here

                    .getData(KEY_PERSPECTIVE);

            ICommandService commandService = (ICommandService) PlatformUI.getWorkbench()
                    .getService(ICommandService.class);

            Command command = commandService.getCommand("org.eclipse.ui.perspectives.showPerspective");


            Map parameters = new HashMap();
            parameters.put("org.eclipse.ui.perspectives.showPerspective.perspectiveId", perspectiveDescriptor.getId());
            ParameterizedCommand parameterizedCommand = ParameterizedCommand.generateCommand(command, parameters);
View Full Code Here

        ATT_COMMAND_ID, warningsToLog, message, id);
    if (commandId == null) {
      return null;
    }

    final Command command = commandService.getCommand(commandId);
    final ParameterizedCommand parameterizedCommand = readParameters(
        configurationElement, warningsToLog, command);

    return parameterizedCommand;
  }
View Full Code Here

        warningsToLog, message, id);
    if (commandId == null) {
      return null;
    }

    final Command command = commandService.getCommand(commandId);
    final ParameterizedCommand parameterizedCommand = readParameters(
        memento, warningsToLog, command);

    return parameterizedCommand;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.commands.Command

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.