|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.gef.commands.CommandStack
A default implementation for the CommandStack interface.
Field Summary | |
protected List |
listeners
the list of CommandStackListener s |
Constructor Summary | |
CommandStack()
Constructs a command stack. |
Method Summary | |
void |
addCommandStackListener(CommandStackListener listener)
Adds the specified listener. |
boolean |
canRedo()
|
boolean |
canUndo()
|
void |
dispose()
This will dispose() all the commands in both the undo and redo stack. |
void |
execute(Command command)
Executes the specified Command if it is executable. |
void |
flush()
Flushes the entire stack and resets the save location to zero. |
Object[] |
getCommands()
|
Command |
getRedoCommand()
Peeks at the top of the redo stack. |
Command |
getUndoCommand()
Peeks at the top of the undo stack. |
int |
getUndoLimit()
Returns the undo limit. |
boolean |
isDirty()
|
void |
markSaveLocation()
|
protected void |
notifyListeners()
Sends notification to all CommandStackListener s. |
void |
redo()
Calls redo on the Command at the top of the redo stack, and pushes that Command onto the undo stack. |
void |
removeCommandStackListener(CommandStackListener listener)
Removes the first occurance of the specified listener. |
void |
setUndoLimit(int undoLimit)
Sets the undo limit. |
void |
undo()
Undoes the most recently executed (or redone) Command. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected List listeners
CommandStackListener
s
Constructor Detail |
public CommandStack()
Method Detail |
public void addCommandStackListener(CommandStackListener listener)
listener
- the listenerpublic boolean canRedo()
true
if it is appropriate to call redo()
.public boolean canUndo()
true
if undo()
can be calledpublic void execute(Command command)
command
- the Command to executepublic void dispose()
dispose()
all the commands in both the undo and redo stack. Both
stacks will be empty afterwards.
public void flush()
public Object[] getCommands()
public Command getRedoCommand()
Command
has a label describing it.
null
public Command getUndoCommand()
Command
has a label describing it.
null
public int getUndoLimit()
-1
is used to indicate no limit.
public boolean isDirty()
public void markSaveLocation()
protected void notifyListeners()
CommandStackListener
s.
public void redo()
canUndo()
returns true
.
public void removeCommandStackListener(CommandStackListener listener)
listener
- the listenerpublic void setUndoLimit(int undoLimit)
-1
is used to indicate no limit.
undoLimit
- the undo limitpublic void undo()
canUndo()
returns true
.
|
Eclipse GEF 2.1 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |