public class ActionManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
EMPTY_STRING
The empty string.
|
static java.lang.String |
REPEAT_LABEL_PREFIX
The prefix for repeat action labels.
|
protected static java.lang.String |
SPACE
A string containing only a space character.
|
Constructor and Description |
---|
ActionManager(CommandManager commandManager)
Constructs a new action manager for the specified command manager.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionManagerChangeListener(IActionManagerChangeListener listener)
Adds the specified listener to the list of action manager change
listeners for this action manager.
|
boolean |
canRepeat()
Retrieves a Boolean indicating whether the last action that was run can
be repeated.
|
void |
clear()
Clears this action manager by discarding the last action that was run.
|
protected void |
fireActionManagerChange(ActionManagerChangeEvent event)
Notifies the listeners for this action manager that the specified event
has occurred.
|
protected IRepeatableAction |
getAction()
Retrieves the value of the
action instance variable. |
CommandManager |
getCommandManager()
Retrieves the value of the
commandManager instance
variable. |
static ActionManager |
getDefault()
Retrieves the default action manager.
|
protected java.util.List |
getListeners()
Retrieves the value of the
listeners instance variable. |
java.lang.String |
getRepeatLabel()
Retrieves the repeat label for the last action that was run.
|
void |
removeActionManagerChangeListener(IActionManagerChangeListener listener)
Removes the specified listener from the list of action manager change
listeners for this action manager.
|
void |
repeat()
Repeats the last action that was run.
|
void |
run(IRepeatableAction act)
Runs the specified action.
|
protected void |
setAction(IRepeatableAction action)
Sets the
action instance variable to the specified value. |
protected static final java.lang.String EMPTY_STRING
public static final java.lang.String REPEAT_LABEL_PREFIX
protected static final java.lang.String SPACE
public ActionManager(CommandManager commandManager)
commandManager
- The command manager for this action manager.public static ActionManager getDefault()
public final CommandManager getCommandManager()
commandManager
instance
variable.commandManager
instance variable.protected final IRepeatableAction getAction()
action
instance variable.action
instance variable.protected final void setAction(IRepeatableAction action)
action
instance variable to the specified value.action
- The new value for the action
instance variable.protected final java.util.List getListeners()
listeners
instance variable.listeners
instance varible.public java.lang.String getRepeatLabel()
public void addActionManagerChangeListener(IActionManagerChangeListener listener)
listener
- The listener to be added.public void removeActionManagerChangeListener(IActionManagerChangeListener listener)
listener
- The listener to be removed.protected void fireActionManagerChange(ActionManagerChangeEvent event)
event
- The action manager change event to be fired.public boolean canRepeat()
true
if the last action can be repeated;
false
otherwise.public void clear()
public void repeat()
java.lang.UnsupportedOperationException
- If an action cannot be repeated.public void run(IRepeatableAction act)
act
- The action to be run.java.lang.UnsupportedOperationException
- If the action cannot be run.com.ibm.xtools.comparemerge.ui.internal.utils.ChainedRuntimeException
- if any exception or error occurs while running the action