Examples of IBindingService


Examples of org.eclipse.ui.keys.IBindingService

   *            Ignored
   * @return <code>null</code>
   */
  public Object execute(final ExecutionEvent event) {
    final IWorkbench workbench = PlatformUI.getWorkbench();
    final IBindingService bindingService = (IBindingService) workbench.getService(IBindingService.class);
    bindingService.openKeyAssistDialog();
    return null;
  }
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

    command.getCommand().addCommandListener(commandListener);
  }

  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

Examples of org.eclipse.ui.keys.IBindingService

          .getImage());
      dec = registry.getFieldDecoration(decId);
    }
    // Always update the decoration text since the key binding may
    // have changed since it was last retrieved.
    IBindingService bindingService = (IBindingService) PlatformUI
        .getWorkbench().getService(IBindingService.class);
    dec.setDescription(NLS.bind(
        WorkbenchMessages.ContentAssist_Cue_Description_Key,
        bindingService.getBestActiveBindingFormattedFor(adapter
            .getCommandId())));

    // Now return the field decoration
    return dec;
  }
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

          .getImage());
      dec = registry.getFieldDecoration(decId);
    }
    // Always update the decoration text since the key binding may
    // have changed since it was last retrieved.
    IBindingService bindingService = (IBindingService) PlatformUI
        .getWorkbench().getService(IBindingService.class);
    dec
        .setDescription(NLS
            .bind(
                WorkbenchMessages.ContentAssist_Cue_Description_Key,
                bindingService
                    .getBestActiveBindingFormattedFor(getCommandId())));

    // Now return the field decoration
    return dec;
  }
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

   */
  public static final String getTooltipAffordanceString() {
    if (!getPreferenceStore().getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE))
      return null;
   
    IBindingService bindingService= (IBindingService)PlatformUI.getWorkbench().getAdapter(IBindingService.class);
    if (bindingService == null)
      return null;

    String keySequence= bindingService.getBestActiveBindingFormattedFor(ITextEditorActionDefinitionIds.SHOW_INFORMATION);
    if (keySequence == null)
      return ""; //$NON-NLS-1$
   
    return NLSUtility.format(TextEditorMessages.Editor_toolTip_affordance, keySequence);
  }
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

    ILabelProvider labelProvider= new LabelProvider() {
      /*
       * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
       */
      public String getText(Object element) {
        IBindingService bindingService= (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
        TriggerSequence[] activeBindings= bindingService.getActiveBindingsFor(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
        if (activeBindings.length == 0)
          return ContentAssistMessages.ContentAssistHandler_contentAssistAvailable;
        return NLSUtility.format(ContentAssistMessages.ContentAssistHandler_contentAssistAvailableWithKeyBinding, activeBindings[0].format());
      }
    };
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

   * @since 3.2
   */
  private String getShowInMenuLabel() {
    String keyBinding= null;
   
    IBindingService bindingService= (IBindingService)PlatformUI.getWorkbench().getAdapter(IBindingService.class);
    if (bindingService != null)
      keyBinding= bindingService.getBestActiveBindingFormattedFor("org.eclipse.ui.navigate.showInQuickMenu"); //$NON-NLS-1$
   
    if (keyBinding == null)
      keyBinding= ""; //$NON-NLS-1$
   
    return NLS.bind(TextEditorMessages.AbstractDecoratedTextEditor_showIn_menu, keyBinding);
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

  /**
   * @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

Examples of org.eclipse.ui.keys.IBindingService

  /**
   * @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

Examples of org.eclipse.ui.keys.IBindingService

    fgLocalBindingManager.setLocale(bindingService.getLocale());
    fgLocalBindingManager.setPlatform(bindingService.getPlatform());
  }

  private static String getKeyboardShortcut(ParameterizedCommand command) {
    IBindingService bindingService= (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
    fgLocalBindingManager.setBindings(bindingService.getBindings());
    try {
      Scheme activeScheme= bindingService.getActiveScheme();
      if (activeScheme != null)
        fgLocalBindingManager.setActiveScheme(activeScheme);
    } catch (NotDefinedException e) {
      Logger.logException(e);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.