Class gui.TrivialUndoManager
Defined in: TrivialUndoManager.js.
Constructor Attributes | Constructor Name and Description |
---|---|
gui.TrivialUndoManager(defaultRules)
|
Field Attributes | Field Name and Description |
---|---|
<static> |
gui.TrivialUndoManager.signalDocumentRootReplaced
|
Method Attributes | Method Name and Description |
---|---|
<inner> |
Pushes the currentUndoState into the undoStates if necessary
|
<inner> |
executeOperations(operations)
Execute all operations in the supplied array
|
<inner> |
extractCursorStates(undoStates)
Reduce the provided undo states to just unique AddCursor followed by
MoveCursor commands for each still-present cursor.
|
Returns true if there are one or more redo states available
|
|
Returns true if there are one or more undo states available
|
|
<inner> | |
moveBackward(states)
Move backward the desired number of states.
|
|
moveForward(states)
Move forward the desired number of states.
|
|
Track the execution of an operation, and add it to the available undo states
|
|
<inner> |
removeCursors(root)
|
<inner> |
removeNode(node)
|
setDocument(newDocument)
Set the OdtDocument to operate on
|
|
setPlaybackFunction(playback_func)
Sets the playback function to use to re-execute operations from the undo stack.
|
|
subscribe(signal, callback)
Subscribe to events related to the undo manager
|
|
unsubscribe(signal, callback)
Unsubscribe to events related to the undo manager
|
|
<inner> |
values(obj)
Converts an object hash into an unordered array of its values
|
Field Detail
setInitialState
<static>
gui.TrivialUndoManager.signalDocumentRootReplaced
Method Detail
<inner>
completeCurrentUndoState()
Pushes the currentUndoState into the undoStates if necessary
<inner>
{undefined}
executeOperations(operations)
Execute all operations in the supplied array
- Parameters:
- {!Array.} operations
- Returns:
- {undefined}
<inner>
{!Array.}
extractCursorStates(undoStates)
Reduce the provided undo states to just unique AddCursor followed by
MoveCursor commands for each still-present cursor. This is used when
restoring the original document state at the start of an undo step
- Parameters:
-
{!Array.
>} undoStates
- Returns:
- {!Array.}
{boolean}
hasRedoStates()
Returns true if there are one or more redo states available
- Returns:
- {boolean}
{boolean}
hasUndoStates()
Returns true if there are one or more undo states available
- Returns:
- {boolean}
initialize()
<inner>
{!Array.}
mostRecentUndoState()
- Returns:
- {!Array.}
{!number}
moveBackward(states)
Move backward the desired number of states. Will stop when the number of
states is reached, or no more undo states are available.
- Parameters:
- {!number} states
- Returns:
- {!number} Returns the number of states actually moved
{!number}
moveForward(states)
Move forward the desired number of states. Will stop when the number of
states is reached, or no more redo states are available.
- Parameters:
- {!number} states
- Returns:
- {!number} Returns the number of states actually moved
{undefined}
onOperationExecuted(op)
Track the execution of an operation, and add it to the available undo states
- Parameters:
- {!ops.Operation} op
- Returns:
- {undefined}
purgeInitialState()
<inner>
removeCursors(root)
- Parameters:
- {!Element} root
<inner>
removeNode(node)
- Parameters:
- {!Node} node
setDocument(newDocument)
Set the OdtDocument to operate on
- Parameters:
- {!ops.Document} newDocument
setPlaybackFunction(playback_func)
Sets the playback function to use to re-execute operations from the undo stack.
- Parameters:
- {!function(!Array.)} playback_func
subscribe(signal, callback)
Subscribe to events related to the undo manager
- Parameters:
- {!string} signal
- {!Function} callback
unsubscribe(signal, callback)
Unsubscribe to events related to the undo manager
- Parameters:
- {!string} signal
- {!Function} callback
<inner>
{!Array.
values(obj)
Converts an object hash into an unordered array of its values
- Parameters:
- {!Object} obj
- Returns:
- {!Array.