Examples of IBindingService


Examples of org.eclipse.ui.keys.IBindingService

  }

  final protected TriggerSequence[] getInvokingCommandKeySequences() {
    if (invokingCommandKeySequences == null) {
      if (invokingCommand != null) {
        IBindingService bindingService = (IBindingService) window
            .getWorkbench().getAdapter(IBindingService.class);
        invokingCommandKeySequences = bindingService
            .getActiveBindingsFor(invokingCommand.getId());
      }
    }
    return invokingCommandKeySequences;
  }
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

*/
       
    /* Fetch the key bindings for the forward and backward commands.  They will not
     * change while the dialog is open, but the context will.  Bug 55581.
     */
        final IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench()
                .getAdapter(IBindingService.class);

        if (commandForward != null) {
            forwardTriggerSequences = bindingService.getActiveBindingsFor(commandForward);
        }
        if (commandBackward != null) {
            backwardTriggerSequences = bindingService.getActiveBindingsFor(commandBackward);
        }

//    final IWorkbenchContextSupport contextSupport = page.getWorkbenchWindow().getWorkbench().getContextSupport();
    try {
      dialog.open();
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

*/
       
    /* Fetch the key bindings for the forward and backward commands.  They will not
     * change while the dialog is open, but the context will.  Bug 55581.
     */
        final IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench()
                .getAdapter(IBindingService.class);

        if (commandForward != null) {
            forwardTriggerSequences = bindingService.getActiveBindingsFor(commandForward);
        }
        if (commandBackward != null) {
            backwardTriggerSequences = bindingService.getActiveBindingsFor(commandBackward);
        }

//    final IWorkbenchContextSupport contextSupport = page.getWorkbenchWindow().getWorkbench().getContextSupport();
    try {
      dialog.open();
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

    if (menuManager != null) {
      item = menuManager.find(SHOW_IN_QUICK_MENU_ID);
      if(item==null && createShowInMenu) {
        String text = Messages.actionShowIn;
        final IWorkbench workbench = PlatformUI.getWorkbench();
        final IBindingService bindingService = (IBindingService) workbench
            .getAdapter(IBindingService.class);
        final TriggerSequence[] activeBindings = bindingService
            .getActiveBindingsFor(SHOW_IN_QUICK_MENU_ID);
        if (activeBindings.length > 0) {
          text += "\t" + activeBindings[0].format();
        }
        item = new MenuManager(text, SHOW_IN_QUICK_MENU_ID);
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

        return matchesKeybinding(keyCode, stateMask, commandId);
    }

    public static boolean matchesKeybinding(int keyCode, int stateMask, String commandId) {
        final IBindingService bindingSvc = (IBindingService) PlatformUI.getWorkbench()
                .getAdapter(IBindingService.class);
        TriggerSequence[] activeBindingsFor = bindingSvc.getActiveBindingsFor(commandId);

        for (TriggerSequence seq : activeBindingsFor) {
            if (seq instanceof KeySequence) {
                KeySequence keySequence = (KeySequence) seq;
                if (matchesKeybinding(keyCode, stateMask, keySequence)) {
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

     * @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) {
        Assert.isNotNull(commandId);
        final IBindingService bindingSvc = (IBindingService) PlatformUI.getWorkbench()
                .getAdapter(IBindingService.class);

        TriggerSequence keyBinding = bindingSvc.getBestActiveBindingFor(commandId);
        if (keyBinding instanceof KeySequence) {
            return (KeySequence) keyBinding;
        }

        List<Tuple<Binding, ParameterizedCommand>> matches = new ArrayList<Tuple<Binding, ParameterizedCommand>>();
        //Ok, it may be that the binding we're looking for is not active, so, let's give a spin on all
        //the bindings
        Binding[] bindings = bindingSvc.getBindings();
        for (Binding binding : bindings) {
            ParameterizedCommand command = binding.getParameterizedCommand();
            if (command != null) {
                if (commandId.equals(command.getId())) {
                    matches.add(new Tuple<Binding, ParameterizedCommand>(binding, command));
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

    styleRangeList.toArray(styleRangeArray);
    return styleRangeArray;
  }

  private static String getShowInMenuLabel() {
    IBindingService bindingService = (IBindingService) PlatformUI
        .getWorkbench().getAdapter(IBindingService.class);
    if (bindingService != null) {
      String keyBinding = bindingService
          .getBestActiveBindingFormattedFor(IWorkbenchCommandConstants.NAVIGATE_SHOW_IN_QUICK_MENU);
      if (keyBinding != null)
        return UIText.UIUtils_ShowInMenuLabel + '\t' + keyBinding;
    }
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

   *         commandId or {@code null} if no binding is defined or if the
   *         binding service returns a {@code TriggerSequence} containing more
   *         than one {@code Trigger}.
   */
  public static KeyStroke getKeystrokeOfBestActiveBindingFor(String commandId) {
    IBindingService bindingService = (IBindingService) PlatformUI
        .getWorkbench().getAdapter(IBindingService.class);
    TriggerSequence ts = bindingService.getBestActiveBindingFor(commandId);
    if (ts == null)
      return null;

    Trigger[] triggers = ts.getTriggers();
    if (triggers.length == 1 && triggers[0] instanceof KeyStroke)
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

    // fBreakContinueTargetOccurrencesAction.update(javaSelection);
    fMethodExitOccurrencesAction.update(phpSelection);
  }

  private String getShortcutString() {
    IBindingService bindingService = (IBindingService) PlatformUI
        .getWorkbench().getAdapter(IBindingService.class);
    if (bindingService == null)
      return null;
    return bindingService
        .getBestActiveBindingFormattedFor(IPHPEditorActionDefinitionIds.SEARCH_OCCURRENCES_IN_FILE_QUICK_MENU);
  }
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.