public static final class ExternalActionManager.CommandCallback extends Object implements IBindingManagerListener, ExternalActionManager.IBindingManagerCallback
ICallback
mechanism that
simply takes a BindingManager
and a
CommandManager
.Constructor and Description |
---|
ExternalActionManager.CommandCallback(BindingManager bindingManager,
CommandManager commandManager)
Constructs a new instance of
CommandCallback with the
workbench it should be using. |
ExternalActionManager.CommandCallback(BindingManager bindingManager,
CommandManager commandManager,
ExternalActionManager.IActiveChecker activeChecker)
Constructs a new instance of
CommandCallback with the
workbench it should be using. |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(String commandId,
IPropertyChangeListener listener)
Adds a listener to the object referenced by
identifier . |
void |
bindingManagerChanged(BindingManagerEvent event)
Notifies that attributes inside an instance of
BindingManager have changed. |
Integer |
getAccelerator(String commandId)
An accessor for the accelerator associated with the item indicated by
the identifier.
|
String |
getAcceleratorText(String commandId)
An accessor for the accelerator text associated with the item
indicated by the identifier.
|
TriggerSequence[] |
getActiveBindingsFor(String commandId)
Returns the active bindings for a particular command identifier.
|
boolean |
isAcceleratorInUse(int accelerator)
Checks to see whether the given accelerator is being used by some
other mechanism (outside of the menus controlled by JFace).
|
boolean |
isActive(String commandId)
Checks whether the item matching this identifier is active.
|
void |
removePropertyChangeListener(String commandId,
IPropertyChangeListener listener)
Removes a listener from the object referenced by
identifier . |
public ExternalActionManager.CommandCallback(BindingManager bindingManager, CommandManager commandManager)
CommandCallback
with the
workbench it should be using. All commands will be considered active.bindingManager
- The binding manager which will provide the callback; must
not be null
.commandManager
- The command manager which will provide the callback; must
not be null
.public ExternalActionManager.CommandCallback(BindingManager bindingManager, CommandManager commandManager, ExternalActionManager.IActiveChecker activeChecker)
CommandCallback
with the
workbench it should be using.bindingManager
- The binding manager which will provide the callback; must
not be null
.commandManager
- The command manager which will provide the callback; must
not be null
.activeChecker
- The callback mechanism for checking whether a command is
active; must not be null
.public final void addPropertyChangeListener(String commandId, IPropertyChangeListener listener)
ExternalActionManager.ICallback
Adds a listener to the object referenced by identifier
.
This listener will be notified if a property of the item is to be
changed. This identifier is specific to mechanism being used. In the
case of the Eclipse workbench, this is the command identifier.
A single instance of the listener may only ever be associated with one identifier. Attempts to add the listener twice (without a removal in between) has undefined behaviour.
addPropertyChangeListener
in interface ExternalActionManager.ICallback
commandId
- The identifier of the item to which the listener should be
attached; must not be null
.listener
- The listener to be added; must not be null
.ExternalActionManager.ICallback.addPropertyChangeListener(String,
IPropertyChangeListener)
public final void bindingManagerChanged(BindingManagerEvent event)
IBindingManagerListener
BindingManager
have changed.
Specific details are described in the BindingManagerEvent
. Changes in the
binding manager can cause the set of defined or active schemes or bindings to change.bindingManagerChanged
in interface IBindingManagerListener
event
- the binding manager event. Guaranteed not to be null
.public final Integer getAccelerator(String commandId)
ExternalActionManager.ICallback
getAccelerator
in interface ExternalActionManager.ICallback
commandId
- The identifier of the item from which the accelerator
should be obtained ; must not be null
.ExternalActionManager.ICallback.getAccelerator(String)
public final String getAcceleratorText(String commandId)
ExternalActionManager.ICallback
getAcceleratorText
in interface ExternalActionManager.ICallback
commandId
- The identifier of the item from which the accelerator text
should be obtained ; must not be null
.ExternalActionManager.ICallback.getAcceleratorText(String)
public final TriggerSequence[] getActiveBindingsFor(String commandId)
getActiveBindingsFor
in interface ExternalActionManager.IBindingManagerCallback
commandId
- The identifier of the command whose bindings are
requested. This argument may be null
. It
is assumed that the command has no parameters.TriggerSequence
)
for a particular command identifier. This value is guaranteed
not to be null
, but it may be empty.public final boolean isAcceleratorInUse(int accelerator)
ExternalActionManager.ICallback
isAcceleratorInUse
in interface ExternalActionManager.ICallback
accelerator
- The accelerator to check -- in SWT's internal accelerator
format.true
if the accelerator is already being used
and shouldn't be used again; false
otherwise.ExternalActionManager.ICallback.isAcceleratorInUse(int)
public final boolean isActive(String commandId)
isActive
in interface ExternalActionManager.ICallback
commandId
- The identifier of the item from which the active state
should be retrieved; must not be null
.true
if the item is active; false
otherwise.public final void removePropertyChangeListener(String commandId, IPropertyChangeListener listener)
ExternalActionManager.ICallback
identifier
. This identifier is specific to mechanism
being used. In the case of the Eclipse workbench, this is the command
identifier.removePropertyChangeListener
in interface ExternalActionManager.ICallback
commandId
- The identifier of the item to from the listener should be
removed; must not be null
.listener
- The listener to be removed; must not be null
.ExternalActionManager.ICallback.removePropertyChangeListener(String,
IPropertyChangeListener)
Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.