Package org.eclipse.ui.internal
Class KeyBindingService
java.lang.Object
org.eclipse.ui.internal.KeyBindingService
- All Implemented Interfaces:
IKeyBindingService,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 Summary
ConstructorsConstructorDescriptionKeyBindingService(IWorkbenchPartSite workbenchPartSite) Constructs a new instance ofKeyBindingServiceon a given workbench site. -
Method Summary
Modifier and TypeMethodDescriptionbooleanactivateKeyBindingService(IWorkbenchSite nestedSite) Marks the service associated withnestedSiteas active if one exists.voiddispose()Disposes this key binding service.getKeyBindingService(IWorkbenchSite nestedSite) An accessor for the nested key binding service associated with a particular site.String[]Returns the active accelerator scope ids.voidregisterAction(IAction action) Registers an action with the key binding service.booleanremoveKeyBindingService(IWorkbenchSite nestedSite) Removes a nested key binding service from this key binding service.voidSets the active accelerator scope ids.voidunregisterAction(IAction action) Unregisters an action with the key binding service.
-
Constructor Details
-
KeyBindingService
Constructs a new instance ofKeyBindingServiceon a given workbench site. This instance is not nested.- Parameters:
workbenchPartSite- The site for which this service will be responsible; should not benull.
-
-
Method Details
-
activateKeyBindingService
Description copied from interface:INestableKeyBindingServiceMarks the service associated withnestedSiteas active if one exists. If there is no service associated, then nothing changes. Calling this method withnullforces deactivation of the current service.- Specified by:
activateKeyBindingServicein interfaceINestableKeyBindingService- Parameters:
nestedSite- The site whose service should be activated;nullif the current service should be deactivated.- Returns:
trueif a service is activated (or deactivated, in the case of anullparameter);falseif 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
Description copied from interface:INestableKeyBindingServiceAn accessor for the nested key binding service associated with a particular site. If the key binding service does not exist for thisnestedSitealready, then a new one should be constructed.- Specified by:
getKeyBindingServicein interfaceINestableKeyBindingService- Parameters:
nestedSite- The site for which the service should be found; should not benull.- Returns:
- The associated service, if any; or a new associated service, if none existed previously.
-
getScopes
Description copied from interface:IKeyBindingServiceReturns the active accelerator scope ids.- Specified by:
getScopesin interfaceIKeyBindingService- Returns:
- the active accelerator scope ids.
-
registerAction
Description copied from interface:IKeyBindingServiceRegisters an action with the key binding service.- Specified by:
registerActionin interfaceIKeyBindingService- Parameters:
action- the action to be registered with the key binding service.
-
removeKeyBindingService
Description copied from interface:INestableKeyBindingServiceRemoves a nested key binding service from this key binding service. The service to remove is determined by thenestedSitewith which it is associated.- Specified by:
removeKeyBindingServicein interfaceINestableKeyBindingService- Parameters:
nestedSite- The site from which to remove the nested service. This site must not benull.- Returns:
trueif the service existed and could be removed;falseotherwise.
-
setScopes
Description copied from interface:IKeyBindingServiceSets the active accelerator scope ids.- Specified by:
setScopesin interfaceIKeyBindingService- Parameters:
scopes- the active accelerator scope ids.
-
unregisterAction
Description copied from interface:IKeyBindingServiceUnregisters an action with the key binding service.- Specified by:
unregisterActionin interfaceIKeyBindingService- Parameters:
action- the action to be unregistered with the key binding service.
-