public interface ICommandStack
Modifier and Type | Method and Description |
---|---|
void |
addCommandStackListener(ICommandStackListener l)
Adds a listener to the command stack.
|
void |
clear()
Clears the command stack's list of executed and undone commands.
|
void |
execute(ICommand cmd,
IProgressMonitor monitor)
Executes the given command.
|
ICommand |
getRedoableCommand()
Returns the command, which will be redone if the
redo
method gets called. |
ICommand |
getUndoableCommand()
Returns the command, which will be undone if the
undo
method gets called. |
boolean |
isRedoable()
Returns true if the command stack currently supports a call to it's redo
method.
|
boolean |
isUndoable()
Returns true if the command stack currently supports a call to it's undo
method.
|
void |
redo(IProgressMonitor monitor)
Redos the last undone command (if it is redoable).
|
void |
removeCommandStackListener(ICommandStackListener l)
Removes a listener from the command stack.
|
void |
undo(IProgressMonitor monitor)
Undos the last executed command (if it is undoable).
|
void execute(ICommand cmd, IProgressMonitor monitor)
cmd
- the command to executemonitor
- a progress monitor used for displaying information during
command execution (for example: percentage complete, current
task, current subtask).void undo(IProgressMonitor monitor)
monitor
- a progress monitor used for displaying information during
command execution (for example: percentage complete, current
task, current subtask).void redo(IProgressMonitor monitor)
monitor
- a progress monitor used for displaying information during
command execution (for example: percentage complete, current
task, current subtask).void clear()
boolean isUndoable()
boolean isRedoable()
ICommand getUndoableCommand()
undo
method gets called. This method is useful for providing feedback to the
user via, for example, an undo menu item.ICommand getRedoableCommand()
redo
method gets called. This method is useful for providing feedback to the
user via, for example, an undo menu item.void addCommandStackListener(ICommandStackListener l)
l
- ICommandStackListenervoid removeCommandStackListener(ICommandStackListener l)
l
- ICommandStackListenerCopyright © 2006–2016 Dirk Lemmermann Software & Consulting. All rights reserved.