Initializes a new instance of the UndoManager class.
The {@link framework.application.Application} that this instance belongs to.
Optional configuration settings for this instance.
The {@link framework.application.Application} that this undo manager instance belongs to.
When true, there are redo operations available on the stack.
When true, there are undo operations available on the stack.
Whether the UndoManager is redoing.
Whether the recording of Undoable instances in the undo history has been suspended using the Suspend method.
Whether the UndoManager is undoing.
The number of operations stored in the history stack.
The maximum number of operations the UndoManager can perform. If a number less than or equal to zero is provided the number of operations is unlimited.
The current operation position.
Returns the outermost current open transaction or null if there is currently no transaction open.
Undo the transaction changes, then remove it from the parent.
Save changes into undo redo stack for top-level transactions.
Adds an undo operation to the stack and clears the redo stack. The redo stack’s contents last as long as undo and redo are performed successively. However, because applying a new change to an object invalidates the previous changes, as soon as a new undo operation is registered, any existing redo stack is cleared. This prevents redo from returning objects to an inappropriate prior state.
An operation to add to the stack.
Starts a transaction for recording undo operations. Undo operations recorded while a UndoTransaction is open, are added to the UndoManager only if the transaction is committed. A rollback will undo, then discard the changes which where registered while the transaction was open.
A short string describing the transaction.
The parent transaction (for nested transactions)
Clears the redo stack.
Clears the undo stack.
Commits the provided transaction. Undo operations recorded while the UndoTransaction is open, are added to the UndoManager only if the transaction is committed. Committing a transaction will commit all transactions nested below it as well. You cannot roll back a transaction once it has been committed.
The transaction to commit.
Destroys this instance. Sets the history stack to null and cleans up all references.
Gets the specified operation from the stack.
The index of the operation to return.
Returns an object with the following properties that describe the current state of the UndoManager: historyStack
, position
.
Gets the next redo operation from the stack.
Gets the next undo operation from the stack.
Moves the current position to the next redo operation and calls the operation's performRedo
method.
Removes the specified operation from the stack. If the index is not valid or out of bounds, then nothing happens.
The index of the operation to remove.
Resumes the recording of Undoable instances in the undo history.
Rolls back (aborts) a transaction from a pending state. A rollback will undo, then discard the changes which where registered
while the transaction was open. Rolling back a nested transaction will roll back its parent transaction as well.
A transaction can only be rolled back from a pending state (after beginTransaction
has been called, but before commitTransaction
is called).
The transaction to roll back.
Sets the maximum number of operations the UndoManager can perform. If a number less than or equal to zero is provided the number of operations is unlimited.
The operation limit
Suspends the recording of Undoable instances in the undo history.
Moves the current position to the next undo operation and calls the operation's performUndo
method.
The UndoManager is a utility object that allows you to easily build applications with undo/redo functionality. Use the UndoManager to add actions (edits, navigation changes, graphics drawing) to the stack. The API includes a set of edit operations (add, delete, update, cut and union), created by inheriting from the Undoable class. You can inherit from the Undoable class to create custom operations that take advantage of undo/redo.