Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.ParameterizedCommand


    if (mappingService != null && commandId != null) {
      mappingService.map(mappingService.getGeneratedCommandId(primaryId,
          secondaryId), commandId);
    }

    return new ParameterizedCommand(command, null);
  }
View Full Code Here


      if (id == null) {
        continue;
      }

      // Try to break out the command part of the action.
      final ParameterizedCommand command = convertActionToCommand(
          element, primaryId, id, warningsToLog);
      if (command == null) {
        continue;
      }
View Full Code Here

    final Command oldBaseCommand = command.getCommand();
    oldBaseCommand.removeCommandListener(commandListener);
    final ICommandService commandService = (ICommandService) serviceLocator
        .getService(ICommandService.class);
    final Command newBaseCommand = commandService.getCommand(id);
    command = new ParameterizedCommand(newBaseCommand, null);
    newBaseCommand.addCommandListener(commandListener);

    // Get the new values.
    final boolean newChecked = isChecked();
    final String newDescription = getDescription();
View Full Code Here

    /*
     * Get the corresponding category and command names. If either is
     * undefined, then we can just stop now. We won't be able to find their
     * name.
     */
    final ParameterizedCommand command = binding.getParameterizedCommand();
    String categoryName = null;
    String commandName = null;
    try {
      categoryName = command.getCommand().getCategory().getName();
      commandName = command.getName();
    } catch (final NotDefinedException e) {
      return; // no name
    }

    // Update the category combo box.
View Full Code Here

   * Handles the selection event on the add button. This removes all
   * user-defined bindings matching the given key sequence, scheme and
   * context. It then adds a new binding with the current selections.
   */
  private final void selectedButtonAdd() {
    final ParameterizedCommand command = getParameterizedCommand();
    final String contextId = getContextId();
    final String schemeId = getSchemeId();
    final KeySequence keySequence = getKeySequence();
    localChangeManager.removeBindings(keySequence, schemeId, contextId,
        null, null, null, Binding.USER);
View Full Code Here

    }
    updateComboCommand();
    updateComboContext();
    final TriggerSequence triggerSequence = getKeySequence();
    updateTableBindingsForTriggerSequence(triggerSequence);
    final ParameterizedCommand command = getParameterizedCommand();
    updateTableBindingsForCommand(command);
    final String contextId = getContextId();
    updateSelection(tableBindingsForTriggerSequence, contextId,
        triggerSequence);
    updateSelection(tableBindingsForCommand, contextId, triggerSequence);
View Full Code Here

   * Updates the contents of the commands combo box, based on the current
   * selection in the category combo box.
   */
  private final void updateComboCommand() {
    // Remember the current selection, so we can restore it later.
    final ParameterizedCommand command = getParameterizedCommand();

    // Figure out where command identifiers apply to the selected category.
    final String categoryId = getCategoryId();
    Set commandIds = (Set) commandIdsByCategoryId.get(categoryId);
    if (commandIds==null) {
View Full Code Here

    final Iterator bindingItr = bindings.iterator();
    while (bindingItr.hasNext()) {
      final Binding binding = (Binding) bindingItr.next();
      final Context context = contextService.getContext(binding
          .getContextId());
      final ParameterizedCommand parameterizedCommand = binding
          .getParameterizedCommand();
      final Command command = parameterizedCommand.getCommand();
      if ((!context.isDefined()) && (!command.isDefined())) {
        continue;
      }

      final TableItem tableItem = new TableItem(
          tableBindingsForTriggerSequence, SWT.NULL);
      tableItem.setData(ITEM_DATA_KEY, binding);

      /*
       * Set the associated image based on the type of binding. Either it
       * is a user binding or a system binding.
       *
       * TODO Identify more image types.
       */
      if (binding.getType() == Binding.SYSTEM) {
        tableItem.setImage(0, IMAGE_BLANK);
      } else {
        tableItem.setImage(0, IMAGE_CHANGE);
      }

      try {
        tableItem.setText(1, context.getName());
        tableItem.setText(2, parameterizedCommand.getName());
      } catch (final NotDefinedException e) {
        throw new Error(
            "Context or command became undefined on a non-UI thread while the UI thread was processing."); //$NON-NLS-1$
      }
    }
View Full Code Here

    final Iterator keyBindingItr = bindings.iterator();
    while (keyBindingItr.hasNext()) {
      final Binding binding = (Binding) keyBindingItr.next();

      // Get the command and category name.
      final ParameterizedCommand command = binding
          .getParameterizedCommand();
      String commandName = Util.ZERO_LENGTH_STRING;
      String categoryName = Util.ZERO_LENGTH_STRING;
      try {
        commandName = command.getName();
        categoryName = command.getCommand().getCategory().getName();
      } catch (final org.eclipse.core.commands.common.NotDefinedException e) {
        // Just use the zero-length string.
      }

      // Ignore items with a meaningless command name.
View Full Code Here

        // Read out the locale and platform.
        final String locale = readOptional(memento, ATT_LOCALE);
        final String platform = readOptional(memento, ATT_PLATFORM);

        // Read out the parameters
        final ParameterizedCommand parameterizedCommand;
        if (command == null) {
          parameterizedCommand = null;
        } else {
          parameterizedCommand = readParameters(memento,
              warningsToLog, command);
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.