Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.Command.define()


      return;

    /* Define Command For Each Label */
    for (final ILabel label : labels) {
      Command command = commandService.getCommand(LABEL_ACTION_PREFIX + label.getOrder());
      command.define(NLS.bind(Messages.Controller_LABEL, label.getName()), NLS.bind(Messages.Controller_LABEL_MSG, label.getName()), commandService.getCategory(RSSOWL_KEYBINDING_CATEGORY));
      command.setHandler(new LabelNewsHandler(label));
    }
  }

  private void updateLabelCommands() {
View Full Code Here


 
  private IContributionItem createContributionItem(IServiceLocator serviceLocator, Action item) {
    ICommandService commandService = (ICommandService) serviceLocator.getService(ICommandService.class);
   
    Command command = commandService.getCommand("io.emmet.eclipse.commands." + item.getId());
    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(
View Full Code Here

  public void testDisabled() throws Exception {
    tracker.setEnabled(false);

    String commandId = System.currentTimeMillis() + "." + System.nanoTime();
    Command command = getCommandService().getCommand(commandId);
    command.define("a", "b", getCommandService().getDefinedCategories()[0]);

    getHandlerService().activateHandler(command.getId(), createHandler());
    getHandlerService().executeCommand(command.getId(), null);

    assertTrue(tracker.getData().isEmpty());
View Full Code Here

    String name = "cmdName";
    String description = "cmdDescription";
    String id = System.currentTimeMillis() + "." + System.nanoTime();
    Command command = getCommandService().getCommand(id);
    command.define(name, description,
        getCommandService().getDefinedCategories()[0]);

    long start = System.currentTimeMillis();
    getHandlerService().activateHandler(command.getId(), createHandler());
    getHandlerService().executeCommand(command.getId(), null);
View Full Code Here

      // Define the command.
      command = commandService.getCommand(commandId);
      final Category category = commandService.getCategory(null);
      final String name = LegacyActionTools.removeAcceleratorText(Action
          .removeMnemonics(label));
      command.define(name, tooltip, category, null);

      // TODO Decide the command state.
      final String style = readOptional(element, ATT_STYLE);
      if (STYLE_RADIO.equals(style)) {
        final State state = new RadioState();
View Full Code Here

        returnType = null;
      } else {
        returnType = commandService.getParameterType(returnTypeId);
      }

      command.define(name, description, category, parameters, returnType,
          helpContextId);
      readState(configurationElement, warningsToLog, command);
    }

    // If there were any warnings, then log them now.
View Full Code Here

  private IContributionItem createContributionItem(IServiceLocator serviceLocator, Action item) {
    ICommandService commandService = (ICommandService) serviceLocator.getService(ICommandService.class);
   
    Command command = commandService.getCommand("io.emmet.eclipse.commands." + item.getId());
    if (!command.isDefined()) {
      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()));
   
View Full Code Here

    Command command = commandService.getCommand(commandId);
    String commandName = "StartExplorer Custom Command " + commandNumberString;
    getLogFacility().logDebug(
        "defining command for " + commandConfig.getCommand() + " as "
            + commandName);
    command.define(commandName, this.getNameFromCommandConfig(commandConfig),
        this.getLazyInitCategory(commandService));
    this.activateHandler(commandConfig, commandId);
    getLogFacility().logDebug(
        "createCommand(" + commandConfig.getCommand() + ") done");
    return command;
View Full Code Here

      return;

    /* Define Command For Each Label */
    for (final ILabel label : labels) {
      Command command = commandService.getCommand(LABEL_ACTION_PREFIX + label.getOrder());
      command.define(NLS.bind(Messages.Controller_LABEL, label.getName()), NLS.bind(Messages.Controller_LABEL_MSG, label.getName()), commandService.getCategory(RSSOWL_KEYBINDING_CATEGORY));
      command.setHandler(new LabelNewsHandler(label));
    }
  }

  private void defineSharingCommands(List<ShareProvider> shareProviders) {
View Full Code Here

      return;

    /* Define Command For Each Share Provider */
    for (final ShareProvider provider : shareProviders) {
      Command command = commandService.getCommand(provider.getId());
      command.define(NLS.bind(Messages.Controller_SHARE, provider.getName()), NLS.bind(Messages.Controller_SHARE_MSG, provider.getName()), commandService.getCategory(RSSOWL_KEYBINDING_CATEGORY));
      command.setHandler(new ShareNewsHandler(provider));
    }
  }

  private void updateLabelCommands() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.