Package org.eclipse.jface.bindings

Examples of org.eclipse.jface.bindings.TriggerSequence


   * @see org.eclipse.jface.action.Action#getText()
   */
  @Override
  public String getText() {
    IBindingService bs = (IBindingService) PlatformUI.getWorkbench().getService(IBindingService.class);
    TriggerSequence binding = bs.getBestActiveBindingFor(ID);

    return binding != null ? NLS.bind(Messages.ToggleReadStateAction_NEWS_READ_BINDING, binding.format()) : Messages.ToggleReadStateAction_NEWS_READ;
  }
View Full Code Here


   * @return binding for proposal cycling
   *
   */
  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 (KeySequence) binding;
    return null;
    }

    private String getIterationGesture() {
        TriggerSequence binding = getIterationBinding();
        return binding != null ? binding.format(): "completion key";
    }
View Full Code Here

            final IBindingManagerCallback bindingManagerCallback = (IBindingManagerCallback) callback;
            final IKeyLookup lookup = KeyLookupFactory.getDefault();
            final TriggerSequence[] triggerSequences = bindingManagerCallback
                .getActiveBindingsFor(commandId);
            for (int i = 0; i < triggerSequences.length; i++) {
              final TriggerSequence triggerSequence = triggerSequences[i];
              final Trigger[] triggers = triggerSequence
                  .getTriggers();
              if (triggers.length == 1) {
                final Trigger trigger = triggers[0];
                if (trigger instanceof KeyStroke) {
                  final KeyStroke currentKeyStroke = (KeyStroke) trigger;
                  final int currentNaturalKey = currentKeyStroke
                      .getNaturalKey();
                  if ((currentKeyStroke.getModifierKeys() == (lookup
                      .getCtrl() | lookup.getShift()))
                      && ((currentNaturalKey >= '0' && currentNaturalKey <= '9')
                          || (currentNaturalKey >= 'A' && currentNaturalKey <= 'F') || (currentNaturalKey == 'U'))) {
                    accelerator = currentKeyStroke
                        .getModifierKeys()
                        | currentNaturalKey;
                    acceleratorText = triggerSequence
                        .format();
                    break;
                  }
                }
              }
View Full Code Here

    /**
     * @see org.eclipse.jface.action.ExternalActionManager.ICallback#getAccelerator(String)
     */
    public final Integer getAccelerator(final String commandId) {
      final TriggerSequence triggerSequence = bindingManager
          .getBestActiveBindingFor(commandId);
      if (triggerSequence != null) {
        final Trigger[] triggers = triggerSequence.getTriggers();
        if (triggers.length == 1) {
          final Trigger trigger = triggers[0];
          if (trigger instanceof KeyStroke) {
            final KeyStroke keyStroke = (KeyStroke) trigger;
            final int accelerator = SWTKeySupport
View Full Code Here

    /**
     * @see org.eclipse.jface.action.ExternalActionManager.ICallback#getAcceleratorText(String)
     */
    public final String getAcceleratorText(final String commandId) {
      final TriggerSequence triggerSequence = bindingManager
          .getBestActiveBindingFor(commandId);
      if (triggerSequence == null) {
        return null;
      }

      return triggerSequence.format();
    }
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.