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
ConstructorDescriptionKeyBindingService
(IWorkbenchPartSite workbenchPartSite) Constructs a new instance ofKeyBindingService
on a given workbench site. -
Method Summary
Modifier and TypeMethodDescriptionboolean
activateKeyBindingService
(IWorkbenchSite nestedSite) Marks the service associated withnestedSite
as active if one exists.void
dispose()
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.void
registerAction
(IAction action) Registers an action with the key binding service.boolean
removeKeyBindingService
(IWorkbenchSite nestedSite) Removes a nested key binding service from this key binding service.void
Sets the active accelerator scope ids.void
unregisterAction
(IAction action) Unregisters an action with the key binding service.
-
Constructor Details
-
KeyBindingService
Constructs a new instance ofKeyBindingService
on 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:INestableKeyBindingService
Marks the service associated withnestedSite
as active if one exists. If there is no service associated, then nothing changes. Calling this method withnull
forces deactivation of the current service.- Specified by:
activateKeyBindingService
in interfaceINestableKeyBindingService
- 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 anull
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
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 thisnestedSite
already, then a new one should be constructed.- Specified by:
getKeyBindingService
in 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:IKeyBindingService
Returns the active accelerator scope ids.- Specified by:
getScopes
in interfaceIKeyBindingService
- Returns:
- the active accelerator scope ids.
-
registerAction
Description copied from interface:IKeyBindingService
Registers an action with the key binding service.- Specified by:
registerAction
in interfaceIKeyBindingService
- Parameters:
action
- the action to be registered with the key binding service.
-
removeKeyBindingService
Description copied from interface:INestableKeyBindingService
Removes a nested key binding service from this key binding service. The service to remove is determined by thenestedSite
with which it is associated.- Specified by:
removeKeyBindingService
in interfaceINestableKeyBindingService
- Parameters:
nestedSite
- The site from which to remove the nested service. This site must not benull
.- Returns:
true
if the service existed and could be removed;false
otherwise.
-
setScopes
Description copied from interface:IKeyBindingService
Sets the active accelerator scope ids.- Specified by:
setScopes
in interfaceIKeyBindingService
- Parameters:
scopes
- the active accelerator scope ids.
-
unregisterAction
Description copied from interface:IKeyBindingService
Unregisters an action with the key binding service.- Specified by:
unregisterAction
in interfaceIKeyBindingService
- Parameters:
action
- the action to be unregistered with the key binding service.
-