class fwt::CommandStack
sys::Obj fwt::CommandStack
@Js
Manages a stack of commands for undo/redo.
- clear
-
CommandStack clear()
Clear the undo/redo stacks. Return this.
- dup
-
This dup()
Create a shallow copy of the undo and redo stacks. The copy maintains references to the original command instances.
- hasRedo
-
Bool hasRedo()
Are any commands available for redo.
- hasUndo
-
Bool hasUndo()
Are any commands available for undo.
- isEmpty
-
Bool isEmpty()
Return is both the undo and redo lists are empty.
- limit
-
Int limit := 1000
Max number of undo commands stored in the stack.
- listRedo
-
Command[] listRedo()
List all the redo commands in the stack.
- listUndo
-
Command[] listUndo()
List all the undo commands in the stack.
- onModify
-
EventListeners onModify()
Callback when command stack is modified.
- push
-
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. - redo
-
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. - toStr
-
virtual override Str toStr()
Return debug string representation.
- undo
-
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.