class fwt::CommandStack

sys::Obj
  fwt::CommandStack

@Js

Source

Manages a stack of commands for undo/redo.

clear

CommandStack clear()

Source

Clear the undo/redo stacks. Return this.

dup

This dup()

Source

Create a shallow copy of the undo and redo stacks. The copy maintains references to the original command instances.

hasRedo

Bool hasRedo()

Source

Are any commands available for redo.

hasUndo

Bool hasUndo()

Source

Are any commands available for undo.

isEmpty

Bool isEmpty()

Source

Return is both the undo and redo lists are empty.

limit

Int limit := 1000

Source

Max number of undo commands stored in the stack.

listRedo

Command[] listRedo()

Source

List all the redo commands in the stack.

listUndo

Command[] listUndo()

Source

List all the undo commands in the stack.

onModify

EventListeners onModify()

Source

Callback when command stack is modified.

push

CommandStack push(Command? c)

Source

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()

Source

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()

Source

Return debug string representation.

undo

Command? undo()

Source

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.