Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.ParameterizedCommand


      if ((platform != null) && (platform.length() == 0)) {
        platform = null;
      }

      // Read out the parameters, if any.
      final ParameterizedCommand parameterizedCommand;
      if (command == null) {
        parameterizedCommand = null;
      } else {
        parameterizedCommand = readParameters(configurationElement,
            warningsToLog, command);
View Full Code Here


   */
  private static final void writeBindingToPreferences(final IMemento parent,
      final Binding binding) {
    final IMemento element = parent.createChild(TAG_KEY_BINDING);
    element.putString(ATT_CONTEXT_ID, binding.getContextId());
    final ParameterizedCommand parameterizedCommand = binding
        .getParameterizedCommand();
    final String commandId = (parameterizedCommand == null) ? null
        : parameterizedCommand.getId();
    element.putString(ATT_COMMAND_ID, commandId);
    element.putString(ATT_KEY_CONFIGURATION_ID, binding.getSchemeId());
    element.putString(ATT_KEY_SEQUENCE, binding.getTriggerSequence()
        .toString());
    element.putString(ATT_LOCALE, binding.getLocale());
    element.putString(ATT_PLATFORM, binding.getPlatform());
    if (parameterizedCommand != null) {
      final Map parameterizations = parameterizedCommand
          .getParameterMap();
      final Iterator parameterizationItr = parameterizations.entrySet()
          .iterator();
      while (parameterizationItr.hasNext()) {
        final Map.Entry entry = (Map.Entry) parameterizationItr.next();
View Full Code Here

          + "\", command \"" + commandId + "\" not defined"); //$NON-NLS-1$ //$NON-NLS-2$
      return;
    }

    if (parameters == null || parameters.size() == 0) {
      command = new ParameterizedCommand(cmd, null);
      return;
    }

    try {
      ArrayList parmList = new ArrayList();
      Iterator i = parameters.entrySet().iterator();
      while (i.hasNext()) {
        Map.Entry entry = (Map.Entry) i.next();
        String parmName = (String) entry.getKey();
        IParameter parm;
        parm = cmd.getParameter(parmName);
        if (parm == null) {
          WorkbenchPlugin
              .log("Unable to create menu item \"" + getId() //$NON-NLS-1$
                  + "\", parameter \"" + parmName + "\" for command \"" //$NON-NLS-1$ //$NON-NLS-2$
                  + commandId + "\" is not defined"); //$NON-NLS-1$
          return;
        }
        parmList.add(new Parameterization(parm, (String) entry
            .getValue()));
      }
      command = new ParameterizedCommand(cmd,
          (Parameterization[]) parmList
              .toArray(new Parameterization[parmList.size()]));
    } catch (NotDefinedException e) {
      // this shouldn't happen as we checked for !defined, but we
      // won't take the chance
View Full Code Here

      }
    }
  }

  private final void bindingRestore(final KeyBinding binding) {
    final ParameterizedCommand cmd = binding.getParameterizedCommand();
    bindingRestore(cmd, false);
  }
View Full Code Here

          whenCombo.setSelection(new StructuredSelection(
              contextService.getContext(binding.getContextId())));
          keySequenceText.setKeySequence(binding.getKeySequence());

        } else if (object instanceof ParameterizedCommand) {
          final ParameterizedCommand command = (ParameterizedCommand) object;
          try {
            commandNameValueLabel.setText(command.getName());
            String description = command.getCommand()
                .getDescription();
            if (description == null) {
              description = Util.ZERO_LENGTH_STRING;
            }
            descriptionValueText.setText(description);
View Full Code Here

    this.window = window;
    final IHandlerService handlerService = (IHandlerService) window
        .getService(IHandlerService.class);
    final ICommandService commandService = (ICommandService) window
        .getService(ICommandService.class);
    final ParameterizedCommand cmd = getCommand(commandService, makeFast);
   
        showDlgAction = new Action(WorkbenchMessages.ShowView_title) {
            public void run() {
        try {
          handlerService.executeCommand(
View Full Code Here

        };
      } catch (NotDefinedException e) {
        // this should never happen
      }
    }
    return new ParameterizedCommand(c, parms);
  }
View Full Code Here

   * @see org.eclipse.ui.internal.CycleBaseHandler#getBackwardCommand()
   */
  protected ParameterizedCommand getBackwardCommand() {
    final ICommandService commandService = (ICommandService) window.getWorkbench().getService(ICommandService.class);
    final Command command = commandService.getCommand("org.eclipse.ui.window.previousEditor"); //$NON-NLS-1$
    ParameterizedCommand commandBack = new ParameterizedCommand(command, null);
    return commandBack;
  }
View Full Code Here

   * @see org.eclipse.ui.internal.CycleBaseHandler#getForwardCommand()
   */
  protected ParameterizedCommand getForwardCommand() {
    final ICommandService commandService = (ICommandService) window.getWorkbench().getService(ICommandService.class);
    final Command command = commandService.getCommand("org.eclipse.ui.window.nextEditor"); //$NON-NLS-1$
    ParameterizedCommand commandF = new ParameterizedCommand(command, null);
    return commandF;
  }
View Full Code Here

   * @see org.eclipse.ui.commands.ICommand#getKeySequenceBindings()
   */
  public final List getKeySequenceBindings() {
    final List legacyBindings = new ArrayList();
    if (parameterizedCommand == null) {
      parameterizedCommand = new ParameterizedCommand(command, null);
    }
    final TriggerSequence[] activeBindings = bindingManager
        .getActiveBindingsFor(parameterizedCommand);
    final int activeBindingsCount = activeBindings.length;
    for (int i = 0; i < activeBindingsCount; i++) {
View Full Code Here

TOP

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

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.