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;
 }
Exemplo n.º 2
0
 protected TriggerSequence registerCommand(String commandId) {
   if (bindingService == null) return null;
   TriggerSequence key = bindingService.getBestActiveBindingFor(commandId);
   if (key != null) {
     triggerableCommands.put(key, commandId);
   }
   return key;
 }
Exemplo n.º 3
0
  /**
   * @param commandId the command we want to know about
   * @return the 'best' key sequence that will activate the given command
   */
  public static KeySequence getCommandKeyBinding(String commandId) {
    final IBindingService bindingSvc =
        (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class);
    TriggerSequence binding = bindingSvc.getBestActiveBindingFor(commandId);
    if (binding instanceof KeySequence) {
      return (KeySequence) binding;
    }

    return null;
  }