Manages a stack of commands for undo/redo.
Slots
- clearSource
-
CommandStack clear()
Clear the undo/redo stacks. Return this.
- dupSource
-
This dup()
Create a shallow copy of the undo and redo stacks. The copy maintains references to the original command instances.
-
private Void fireModified()
- hasRedoSource
-
Bool hasRedo()
Are any commands available for redo.
- hasUndoSource
-
Bool hasUndo()
Are any commands available for undo.
- isEmptySource
-
Bool isEmpty()
Return is both the undo and redo lists are empty.
- limitSource
-
Int limit := 1000
Max number of undo commands stored in the stack.
- listRedoSource
-
Command[] listRedo()
List all the redo commands in the stack.
- listUndoSource
-
Command[] listUndo()
List all the undo commands in the stack.
- onModifySource
-
@transient
readonly EventListeners onModify := EventListeners()Callback when command stack is modified.
- pushSource
-
CommandStack push(Command? c)
Push a command onto the undo stack. This clears the redo stack. If c is null or returns false for
Command.undoable
then ignore this call. Return this. - redoSource
-
Command? redo()
Call
Command.redo
on the last redo command and then push it onto the undo stack. If the redo stack is empty, then ignore this call. Return command redone. -
private Command[] redoStack := Command[,]
- toStrSource
-
override Str toStr()
Overrides sys::Obj.toStr
Return debug string representation.
- undoSource
-
Command? undo()
Call
Command.undo
on the last undo command and then push it onto the redo stack. If the undo stack is empty, then ignore this call. Return command undone. -
private Command[] undoStack := Command[,]