|
GEF v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This is a simple and obvious interface for an undoable stack of commands with a listener.
See Command for more details about the command methods that this implementation uses
and CommandStackListener for details about the listener.
| Field Summary | |
static String |
copyright
|
| Method Summary | |
void |
addCommandStackListener(CommandStackListener listener)
This adds a listener to the command stack, which will be notified whenever a command has been processed on the stack. |
boolean |
canRedo()
This returns whether there are commands past the top of the stack that can be redone. |
boolean |
canUndo()
This returns whether the top command on the stack can be undone. |
void |
execute(Command command)
This will clear any redoable commands not yet redone, add the command, and then execute the command. |
void |
flush()
This will dispose all the commands in the stack. |
Command |
getMostRecentCommand()
This returns the command most recently executed, undone, or redone. |
Command |
getRedoCommand()
This returns the command that will be redone if redo() is called. |
Command |
getUndoCommand()
This returns the command that will be undone if undo() is called. |
void |
redo()
This moves the top of the stack up, redoing the new top command. |
void |
removeCommandStackListener(CommandStackListener listener)
This removes a previously added listener. |
void |
undo()
This moves the top of the stack down, undoing what was formerly the top command. |
| Field Detail |
public static final String copyright
| Method Detail |
public void execute(Command command)
public boolean canUndo()
public void undo()
public boolean canRedo()
public Command getUndoCommand()
undo() is called.public Command getRedoCommand()
redo() is called.public Command getMostRecentCommand()
public void redo()
public void flush()
public void addCommandStackListener(CommandStackListener listener)
public void removeCommandStackListener(CommandStackListener listener)
|
GEF v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||