Examples of IBindingService


Examples of org.eclipse.ui.keys.IBindingService

   * no short cut is assigned.
   *
   * @return the shortcut as a human readable string or <code>null</code>
   */
  private String getShortcutString() {
    IBindingService bindingService= (IBindingService)PlatformUI.getWorkbench().getAdapter(IBindingService.class);
    if (bindingService == null)
      return null;
    return bindingService.getBestActiveBindingFormattedFor(getActionDefinitionId());
  }
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

  /*
   * @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.MakeNewsStickyAction_NEWS_STICKY_BINDING, binding.format()) : Messages.MakeNewsStickyAction_NEWS_STICKY;
  }
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

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

Examples of org.eclipse.ui.keys.IBindingService

    helpMenu.add(new Separator());
    helpMenu.add(new Action(Messages.ApplicationActionBarAdvisor_SHOW_KEY_BINDINGS) {
      @Override
      public void run() {
        IWorkbench workbench = PlatformUI.getWorkbench();
        IBindingService bindingService = (IBindingService) workbench.getService(IBindingService.class);
        bindingService.openKeyAssistDialog();
      }
    });

    helpMenu.add(new Separator());
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

       
        // Only unbind default backspace action from textWidget if there is a key binding
        // for "Delete Previous" registered through Preferences > Keys. Otherwise we'd lose
        // backspace functionality:

        IBindingService service = (IBindingService) getSite().getService(IBindingService.class);
        if (service.getActiveBindingsFor(ITextEditorActionDefinitionIds.DELETE_PREVIOUS).length > 0)
        {
            action = new BackspaceAction(ST.DELETE_PREVIOUS);
            action.setActionDefinitionId(ITextEditorActionDefinitionIds.DELETE_PREVIOUS);
            setAction(ITextEditorActionDefinitionIds.DELETE_PREVIOUS, action);
            textWidget.setKeyBinding(SWT.BS, SWT.NULL);
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

 
  /**
   *
   */
  public static String getShortcut(String commandId) {
    final IBindingService keys = (IBindingService) PlatformUI.getWorkbench().getService(IBindingService.class);
   
    if (commandId != null && keys != null) {
      TriggerSequence trigger = keys.getBestActiveBindingFor(commandId);
      if (trigger != null && trigger.getTriggers().length > 0) {
        return trigger.format();
      }
    }
   
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

    public static final String NAVIGATE_SHOW_IN_QUICK_MENU = "org.eclipse.ui.navigate.showInQuickMenu"; //$NON-NLS-1$

    private String getShowInMenuLabel() {
        String keyBinding = null;

        final IBindingService bindingService = (IBindingService) PlatformUI
                .getWorkbench().getAdapter(IBindingService.class);
        if (bindingService != null) {
            keyBinding = bindingService
                    .getBestActiveBindingFormattedFor(NAVIGATE_SHOW_IN_QUICK_MENU);
        }

        if (keyBinding == null) {
            keyBinding = ""; //$NON-NLS-1$
View Full Code Here

Examples of org.eclipse.ui.keys.IBindingService

     *            the command to be checked
     * @return true if the given key event can trigger the passed command (and
     *         false otherwise).
     */
    public static boolean matchesKeybinding(final KeyEvent event, final String commandId) {
        final IBindingService bindingSvc = (IBindingService) PlatformUI.getWorkbench()
                .getAdapter(IBindingService.class);
        final TriggerSequence[] activeBindingsFor = bindingSvc
                .getActiveBindingsFor(commandId);

        for (final TriggerSequence seq : activeBindingsFor) {
            if (seq instanceof KeySequence) {
                final KeySequence keySequence = (KeySequence) seq;
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(final String commandId) {
        final IBindingService bindingSvc = (IBindingService) PlatformUI.getWorkbench()
                .getAdapter(IBindingService.class);
        final TriggerSequence binding = bindingSvc.getBestActiveBindingFor(commandId);
        if (binding instanceof KeySequence) {
            return (KeySequence) binding;
        }

        return null;
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) window
        .getWorkbench().getService(IBindingService.class);
    forwardTriggerSequences = bindingService
        .getActiveBindingsFor(commandForward);
    backwardTriggerSequences = bindingService
        .getActiveBindingsFor(commandBackward);

    final IContextService contextService = (IContextService) window
        .getWorkbench().getService(IContextService.class);
    try {
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.