public class OtEngine extends Object
Constructor and Description |
---|
OtEngine(Document document)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
executeCommand(OtCommand command,
boolean pending)
Executes the given command in the correct sequence.
|
void |
finalizeCommand(long pendingCommandId,
long finalizedContentVersion)
Moves a commands from the "pending" queue to the "finalized" command queue.
|
Document |
getCurrentDocument()
Gets the current document.
|
boolean |
hasCommand(OtCommand command)
Returns true if the OT engine has already seen the given command.
|
boolean |
hasPendingCommands()
Returns true if there is at least one pending command in the engine.
|
OtCommand |
redo(long contentVersion)
Called to redo a specific command by its contentVersion identifier.
|
OtCommand |
redoLastLocalCommand()
Called to redo the last "undone" local command.
|
OtCommand |
undo(long contentVersion)
Called to undo a specific command by its contentVersion identifier.
|
OtCommand |
undoLastLocalCommand()
Called to undo the last local command.
|
public OtEngine(Document document)
document
- public Document getCurrentDocument()
public boolean hasPendingCommands()
public boolean hasCommand(OtCommand command)
command
- public void executeCommand(OtCommand command, boolean pending)
command
- pending
- public void finalizeCommand(long pendingCommandId, long finalizedContentVersion)
pendingCommandId
- finalizedContentVersion
- public OtCommand undoLastLocalCommand()
public OtCommand redoLastLocalCommand()
public OtCommand undo(long contentVersion)
contentVersion
- public OtCommand redo(long contentVersion)
contentVersion
- Copyright © 2019 Red Hat. All rights reserved.