Home

# Class goog.editor.plugins.UndoRedoManager

Manages undo and redo operations through a series of {@code UndoRedoState}s maintained on undo and redo stacks.

extends goog.events.EventTarget

Instance Method Summary
| `addAction_(?Object action)` Adds an action to the queue of pending undo or redo actions. If no actions are pending, immediately performs the action.
| `addState(?goog.editor.plugins.UndoRedoState state)` Add state to the undo stack. This clears the redo stack.
| `clearHistory()` Clears the undo and redo stacks.
| `dispatchStateChange_()` Dispatches a STATE_CHANGE event with this manager as the target.
| `doAction_()` Executes the action at the front of the pending actions queue. If an action is already in progress or the queue is empty, does nothing.
| `finishAction_()` Finishes processing the current in progress action, starting the next queued action if one exists.
| `hasRedoState() ⇒ boolean`
| `hasUndoState() ⇒ boolean`
| `redo()` Performs the redo operation of the state at the top of the redo stack, moving that state to the top of the undo stack. If redo undo stack is empty, does nothing.
| `redoPeek() ⇒ (goog.editor.plugins.UndoRedoState|null|undefined)`
| `setMaxUndoDepth(number depth)` Set the max undo stack depth (not the real memory usage).
| `shiftState_(?Array fromStack, ?Array toStack)` Move a state from one stack to the other, performing the appropriate undo or redo action.
| `undo()` Performs the undo operation of the state at the top of the undo stack, moving that state to the top of the redo stack. If the undo stack is empty, does nothing.
| `undoPeek() ⇒ (goog.editor.plugins.UndoRedoState|null|undefined)`