Package org.eclipse.core.commands

Examples of org.eclipse.core.commands.ParameterizedCommand


                   
                    IParameter paramTMLFile = command.getParameter("de.innovationgate.eclipse.ids.commands.OpenModuleInBrowser.paramTMLFilePath");
 
                    Parameterization parm = new Parameterization(paramTMLFile, getInputFile().getFullPath().toString());
      
                    ParameterizedCommand parmCommand = new ParameterizedCommand(command, new Parameterization[] { parm });
                    handlerService.executeCommand(parmCommand, null);
                }
                catch (NotDefinedException e1) {
                }
View Full Code Here


   * @return The array of active triggers (<code>TriggerSequence</code>)
   *         for a particular command identifier. This value is guaranteed not
   *         to be <code>null</code>, but it may be empty.
   */
  public final TriggerSequence[] getActiveBindingsFor(final String commandId) {
    final ParameterizedCommand parameterizedCommand = new ParameterizedCommand(
        commandManager.getCommand(commandId), null);
    return getActiveBindingsFor(parameterizedCommand);
  }
View Full Code Here

   *         <code>null</code> if no bindings are active for the given
   *         command.
   * @since 3.2
   */
  public final TriggerSequence getBestActiveBindingFor(final String commandId) {
    return getBestActiveBindingFor(new ParameterizedCommand(commandManager.getCommand(commandId), null));
  }
View Full Code Here

        while (listenerItr.hasNext()) {
          final Map.Entry entry = (Map.Entry) listenerItr.next();
          final String commandId = (String) entry.getKey();
          final Command command = commandManager
              .getCommand(commandId);
          final ParameterizedCommand parameterizedCommand = new ParameterizedCommand(
              command, null);
          if (event.isActiveBindingsChangedFor(parameterizedCommand)) {
            Object value = entry.getValue();
            PropertyChangeEvent propertyChangeEvent = new PropertyChangeEvent(event
                .getManager(), IAction.TEXT, null, null);
View Full Code Here

   *             log the message, display a dialog, or ignore this exception
   *             entirely.
   */
  final boolean executeCommand(final Binding binding, final Event trigger)
      throws CommandException {
    final ParameterizedCommand parameterizedCommand = binding
        .getParameterizedCommand();

    if (DEBUG) {
      Tracing.printTrace("KEYS", //$NON-NLS-1$
          "WorkbenchKeyboard.executeCommand(commandId = '" //$NON-NLS-1$
              + parameterizedCommand.getId() + "', parameters = " //$NON-NLS-1$
              + parameterizedCommand.getParameterMap() + ')');
    }

    // Reset the key binding state (close window, clear status line, etc.)
    resetState(false);

    // Dispatch to the handler.
    final Command command = parameterizedCommand.getCommand();
    final boolean commandDefined = command.isDefined();
    final boolean commandHandled = command.isHandled();
    final boolean commandEnabled = command.isEnabled();

    if (DEBUG && DEBUG_VERBOSE) {
View Full Code Here

   */
  private String getKeySequenceString() {
    final Command command = commandService
        .getCommand("org.eclipse.ui.window.showKeyAssist"); //$NON-NLS-1$
    final TriggerSequence[] keyBindings = bindingService
        .getActiveBindingsFor(new ParameterizedCommand(command, null));
    final int keyBindingsCount = keyBindings.length;
    final KeySequence currentState = keyBindingState.getCurrentSequence();
    final int prefixSize = currentState.getKeyStrokes().length;

    // Try to find the first possible matching key binding.
View Full Code Here

    final Iterator itemsItr = partialMatches.entrySet().iterator();
    while (itemsItr.hasNext()) {
      final Map.Entry entry = (Map.Entry) itemsItr.next();
      final TriggerSequence sequence = (TriggerSequence) entry.getValue();
      final Binding binding = (Binding) entry.getKey();
      final ParameterizedCommand command = binding
          .getParameterizedCommand();
      try {
        final String[] text = { command.getName(), sequence.format() };
        final TableItem item = new TableItem(completionsTable, SWT.NULL);
        item.setText(text);
        item.setData(BINDING_KEY, binding);
        bindings.add(binding);
      } catch (NotDefinedException e) {
View Full Code Here

    // Create a sorted map that sorts based on lexicographical order.
    final SortedMap sortedMatches = new TreeMap(new Comparator() {
      public final int compare(final Object a, final Object b) {
        final Binding bindingA = (Binding) a;
        final Binding bindingB = (Binding) b;
        final ParameterizedCommand commandA = bindingA
            .getParameterizedCommand();
        final ParameterizedCommand commandB = bindingB
            .getParameterizedCommand();
        try {
          return commandA.getName().compareTo(commandB.getName());
        } catch (final NotDefinedException e) {
          // should not happen
          return 0;
        }
      }
View Full Code Here

  public final int open(Collection bindings) {
    conflictMatches = new TreeMap(new Comparator() {
      public final int compare(final Object a, final Object b) {
        final Binding bindingA = (Binding) a;
        final Binding bindingB = (Binding) b;
        final ParameterizedCommand commandA = bindingA
            .getParameterizedCommand();
        final ParameterizedCommand commandB = bindingB
            .getParameterizedCommand();
        try {
          return commandA.getName().compareTo(commandB.getName());
        } catch (final NotDefinedException e) {
          // should not happen
          return 0;
        }
      }
View Full Code Here

   * @see org.eclipse.ui.dialogs.PatternFilter#isLeafMatch(org.eclipse.jface.viewers.Viewer,
   *      java.lang.Object)
   */
  protected boolean isLeafMatch(Viewer viewer, Object element) {
    if (filterCategories) {
      final ParameterizedCommand cmd = getCommand(element);
      try {
        if (cmd != null
            && cmd.getCommand().getCategory() == uncategorized) {
          return false;
        }
      } catch (NotDefinedException e) {
        return false;
      }
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.