Class KeyBindingService

java.lang.Object
org.eclipse.ui.internal.KeyBindingService
All Implemented Interfaces:
IKeyBindingService, INestableKeyBindingService

public final class KeyBindingService extends Object implements INestableKeyBindingService
This service provides a nestable implementation of a key binding service. This class is provided for backwards compatibility only, and might be removed in the future. All of the functionality is the class can be duplicated by using the commands and contexts API.
Since:
2.0
  • Constructor Details

    • KeyBindingService

      public KeyBindingService(IWorkbenchPartSite workbenchPartSite)
      Constructs a new instance of KeyBindingService on a given workbench site. This instance is not nested.
      Parameters:
      workbenchPartSite - The site for which this service will be responsible; should not be null.
  • Method Details

    • activateKeyBindingService

      public boolean activateKeyBindingService(IWorkbenchSite nestedSite)
      Description copied from interface: INestableKeyBindingService
      Marks the service associated with nestedSite as active if one exists. If there is no service associated, then nothing changes. Calling this method with null forces deactivation of the current service.
      Specified by:
      activateKeyBindingService in interface INestableKeyBindingService
      Parameters:
      nestedSite - The site whose service should be activated; null if the current service should be deactivated.
      Returns:
      true if a service is activated (or deactivated, in the case of a null parameter); false if nothing changed.
    • dispose

      public void dispose()
      Disposes this key binding service. This clears out all of the submissions held by this service, and its nested services.
    • getKeyBindingService

      public IKeyBindingService getKeyBindingService(IWorkbenchSite nestedSite)
      Description copied from interface: INestableKeyBindingService
      An accessor for the nested key binding service associated with a particular site. If the key binding service does not exist for this nestedSite already, then a new one should be constructed.
      Specified by:
      getKeyBindingService in interface INestableKeyBindingService
      Parameters:
      nestedSite - The site for which the service should be found; should not be null.
      Returns:
      The associated service, if any; or a new associated service, if none existed previously.
    • getScopes

      public String[] getScopes()
      Description copied from interface: IKeyBindingService
      Returns the active accelerator scope ids.
      Specified by:
      getScopes in interface IKeyBindingService
      Returns:
      the active accelerator scope ids.
    • registerAction

      public void registerAction(IAction action)
      Description copied from interface: IKeyBindingService
      Registers an action with the key binding service.
      Specified by:
      registerAction in interface IKeyBindingService
      Parameters:
      action - the action to be registered with the key binding service.
    • removeKeyBindingService

      public boolean removeKeyBindingService(IWorkbenchSite nestedSite)
      Description copied from interface: INestableKeyBindingService
      Removes a nested key binding service from this key binding service. The service to remove is determined by the nestedSite with which it is associated.
      Specified by:
      removeKeyBindingService in interface INestableKeyBindingService
      Parameters:
      nestedSite - The site from which to remove the nested service. This site must not be null.
      Returns:
      true if the service existed and could be removed; false otherwise.
    • setScopes

      public void setScopes(String[] scopes)
      Description copied from interface: IKeyBindingService
      Sets the active accelerator scope ids.
      Specified by:
      setScopes in interface IKeyBindingService
      Parameters:
      scopes - the active accelerator scope ids.
    • unregisterAction

      public void unregisterAction(IAction action)
      Description copied from interface: IKeyBindingService
      Unregisters an action with the key binding service.
      Specified by:
      unregisterAction in interface IKeyBindingService
      Parameters:
      action - the action to be unregistered with the key binding service.