Fan

 

class

fwt::CommandStack

sys::Obj
  fwt::CommandStack

Manages a stack of commands for undo/redo.

Slots

clearSource

CommandStack clear()

Clear the undo/redo stacks. Return this.

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

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.

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.