Manages a stack of commands for undo/redo.
Slots
- clearSource
-
CommandStack clear()Clear the undo/redo stacks. Return this.
-
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 := 1000Max 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
-
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.undoablethen ignore this call. Return this. - redoSource
-
Command? redo()Call
Command.redoon 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[,] - undoSource
-
Command? undo()Call
Command.undoon 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[,]