public abstract class IlvSingleActionHandler extends Object implements ActionHandler
Constructor and Description |
---|
IlvSingleActionHandler(String command)
Constructs a new
IlvSingleActionHandler . |
Modifier and Type | Method and Description |
---|---|
abstract void |
actionPerformed(ActionEvent e)
Invoked when an event for the action associated with this action handler
occurs.
|
Action |
getAction()
Returns the action this object handles.
|
String |
getCommand()
Returns the command key of the action handled by this action handler.
|
boolean |
isProcessingAction(String command)
Determines whether this object handles the action with the
specified
command key. |
void |
setAction(Action action)
Sets the action that this instance handles.
|
void |
setCommand(String command)
Sets the command key of the action handled by this object.
|
boolean |
updateAction(Action action)
Invoked by the application for updating the state of the specified
action . |
protected boolean |
updateSingleAction(Action action)
Invoked by the
updateAction(javax.swing.Action) method. |
public IlvSingleActionHandler(String command)
IlvSingleActionHandler
.command
- The command key of the action that this object handles.setCommand(java.lang.String)
public String getCommand()
setCommand(java.lang.String)
public void setCommand(String command)
command
- The command key.getCommand()
public boolean isProcessingAction(String command)
command
key.isProcessingAction
in interface ActionHandler
command
- The command key of the action.true
if the specified command key is equal to the
command key returned by getCommand()
; false
otherwise.public abstract void actionPerformed(ActionEvent e)
The command key returned by e.getActionCommand()
is equal to
the command key returned by getCommand()
.
actionPerformed
in interface ActionListener
e
- The action event to process.public boolean updateAction(Action action)
action
. This method should not be overridden. Instead,
the method updateSingleAction(javax.swing.Action)
should be overridden to update
the state of the action handled by this object.updateAction
in interface ActionHandler
action
- The action to update.true
if the action handler has updated the state
of the action; false
otherwise.updateSingleAction(javax.swing.Action)
protected boolean updateSingleAction(Action action)
updateAction(javax.swing.Action)
method.
This method should be overridden instead of the updateAction(javax.swing.Action)
method,
since it is invoked only when the specified action
corresponds to
the action that this object handles.action
- The action to update the state of.true
if the action has been updated or
false
to indicate that the default updating mechanism
of the application should be used to disable the action if no action handler
could be found for processing the state of the action.public Action getAction()
updateAction(javax.swing.Action)
has been invoked
the first time, by using the command key returned by the getCommand()
method.null
if the
action has not been initialized yet or if the command returned by the
getCommand()
method does not correspond to an existing action.setAction(javax.swing.Action)
,
getCommand()
public void setAction(Action action)
setCommand(java.lang.String)
method.action
- The new action that this instance handles.getAction()
,
setCommand(java.lang.String)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.