Package org.eclipse.jface.bindings

Examples of org.eclipse.jface.bindings.TriggerSequence


    final TableColumn columnKeySequence = new TableColumn(completionsTable,
        SWT.LEFT, 1);
    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


  public final int getAccelerator() {
    final String commandId = getActionDefinitionId();
    final IBindingService bindingService = (IBindingService) serviceLocator
        .getService(IBindingService.class);
    final TriggerSequence triggerSequence = bindingService
        .getBestActiveBindingFor(commandId);
    if (triggerSequence instanceof KeySequence) {
      final KeySequence keySequence = (KeySequence) triggerSequence;
      final KeyStroke[] keyStrokes = keySequence.getKeyStrokes();
      if (keyStrokes.length == 1) {
View Full Code Here

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

          .getPartialMatches(sequence);
      final Map returnValue = new HashMap();
      final Iterator matchItr = partialMatches.entrySet().iterator();
      while (matchItr.hasNext()) {
        final Map.Entry entry = (Map.Entry) matchItr.next();
        final TriggerSequence trigger = (TriggerSequence) entry
            .getKey();
        if (trigger instanceof org.eclipse.jface.bindings.keys.KeySequence) {
          final org.eclipse.jface.bindings.keys.KeySequence triggerKey = (org.eclipse.jface.bindings.keys.KeySequence) trigger;
          returnValue.put(KeySequence.getInstance(triggerKey
              .toString()), entry.getValue());
View Full Code Here

    }
    final TriggerSequence[] activeBindings = bindingManager
        .getActiveBindingsFor(parameterizedCommand);
    final int activeBindingsCount = activeBindings.length;
    for (int i = 0; i < activeBindingsCount; i++) {
      final TriggerSequence triggerSequence = activeBindings[i];
      if (triggerSequence instanceof org.eclipse.jface.bindings.keys.KeySequence) {
        legacyBindings
            .add(new KeySequenceBinding(
                KeySequence
                    .getInstance((org.eclipse.jface.bindings.keys.KeySequence) triggerSequence),
View Full Code Here

  /**
   * @return {@link String} representing the user command to iterate to the next page
   */
  private String getIterationGesture() {
    TriggerSequence binding= getIterationBinding();
    return binding != null ?
        NLS.bind(SSEUIMessages.ContentAssist_press, new Object[] { binding.format() })
        : SSEUIMessages.ContentAssist_click;
  }
View Full Code Here

  /**
   * @return {@link KeySequence} used by user to iterate to the next page
   */
  private KeySequence getIterationBinding() {
      final IBindingService bindingSvc= (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
    TriggerSequence binding= bindingSvc.getBestActiveBindingFor(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
    if (binding instanceof KeySequence)
      return (KeySequence) binding;
    return null;
    }
View Full Code Here

  /**
   * @return {@link String} representing the user command to iterate to the next page
   */
  private String getIterationGesture() {
    TriggerSequence binding= getIterationBinding();
    return binding != null ?
        NLS.bind(SSEUIMessages.ContentAssist_press, new Object[] { binding.format() })
        : SSEUIMessages.ContentAssist_click;
  }
View Full Code Here

  /**
   * @return {@link KeySequence} used by user to iterate to the next page
   */
  private KeySequence getIterationBinding() {
      final IBindingService bindingSvc= (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
    TriggerSequence binding= bindingSvc.getBestActiveBindingFor(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
    if (binding instanceof KeySequence)
      return (KeySequence) binding;
    return null;
    }
View Full Code Here

   
                if (commandForward != null) {
                    if (forwardTriggerSequences != null) {
                        final int forwardCount = forwardTriggerSequences.length;
                        for (int i = 0; i < forwardCount; i++) {
                            final TriggerSequence triggerSequence = forwardTriggerSequences[i];

                            // Compare the last key stroke of the binding.
                            final Trigger[] triggers = triggerSequence.getTriggers();
                            final int triggersLength = triggers.length;
                            if ((triggersLength > 0)
                                    && (triggers[triggersLength - 1].equals(keyStroke))) {
                                acceleratorForward = true;
                                break;
                            }
                        }
                    }
                }

                if (commandBackward != null) {
                    if (backwardTriggerSequences != null) {
                        final int backwardCount = backwardTriggerSequences.length;
                        for (int i = 0; i < backwardCount; i++) {
                            final TriggerSequence triggerSequence = backwardTriggerSequences[i];

                            // Compare the last key stroke of the binding.
                            final Trigger[] triggers = triggerSequence.getTriggers();
                            final int triggersLength = triggers.length;
                            if ((triggersLength > 0)
                                    && (triggers[triggersLength - 1].equals(keyStroke))) {
                                acceleratorBackward = true;
                                break;
View Full Code Here

TOP

Related Classes of org.eclipse.jface.bindings.TriggerSequence

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.