|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OperationManager
Field Summary | |
---|---|
static String |
TRACK_CHANGES_ELEMENT_NAME
|
static String |
TRACK_CHANGES_NAMESPACE
The namespace used for elements in the serialized XML. |
static String |
XML_VERSION_ATTRIBUTE
|
static String |
XML_VERSION_ATTRIBUTE_VALUE
|
Method Summary | |
---|---|
void |
accept(Operation operation,
HTMLDocument document)
Accept an operation. |
void |
addOperationChangeListener(OperationListener listener)
Add an operation change listener to the manager, listening for when the state of operations changes. |
String |
excludeRemovedWords(int offset,
String text)
Retrieves text with track changes hidden regardless of the current state |
Color |
getColorForUser(Operation operation)
Get the color to use to render changes by an operation. |
Color |
getColorForUser(String author)
Get the color to use to render changes by author. |
int |
getOperationCount()
Get the number of operations that are currently being tracked. |
Collection<Operation> |
getOperations()
Get the operations currently being tracked by this operation manager. |
Collection<Operation> |
getOperationsInRange(int start,
int end)
Get the list of operations that affect the specified range. |
Collection<Operation> |
getOperationsToRenderInRange(int start,
int end)
Get the list of operations that affect the rendering in the specified range. |
String |
getUsername()
Returns the current user name. |
boolean |
isRemoved(int startOffset,
int endOffset)
Determine if all content in the specified range is marked as removed. |
boolean |
isTrackChangesEnabled()
Returns whether or not changes are currently being tracked. |
Operation |
nextOperation(int afterOffset)
Get the operation whose affected range starts closest to, but after afterOffset. |
Operation |
nextOperation(Operation currentOperation)
Get the next operation after currentOperation, ordered by the start of the affected range. |
Operation |
previousOperation(int beforeOffset)
Get the operation whose affected range starts closest to, but before or equal to beforeOffset. |
Operation |
previousOperation(Operation currentOperation)
Get the operation before currentOperation, ordered by the start of the affected range. |
void |
reject(Operation operation,
HTMLDocument document)
Reject an operation. |
void |
removeOperation(Operation operation)
Remove an operation from the manager without doing anything else. |
void |
removeOperationChangeListener(OperationListener listener)
Remove an operation change listener from the manager. |
Field Detail |
---|
static final String TRACK_CHANGES_NAMESPACE
static final String TRACK_CHANGES_ELEMENT_NAME
static final String XML_VERSION_ATTRIBUTE_VALUE
static final String XML_VERSION_ATTRIBUTE
Method Detail |
---|
boolean isTrackChangesEnabled()
true
if track changes is enabled, otherwise false
.int getOperationCount()
Collection<Operation> getOperations()
The operations are ordered by the start of the range in the document they affect.
Collection<Operation> getOperationsToRenderInRange(int start, int end)
Note that if track changes rendering is off, this method will always return an empty collection.
The operations are ordered by the start of the range in the document they affect.
start
- the start of the range to check for operations in.end
- the end of the range to check for operations in.
Collection<Operation> getOperationsInRange(int start, int end)
The operations are ordered by the start of the range in the document they affect.
start
- the start of the range to check for operations in.end
- the end of the range to check for operations in.
void accept(Operation operation, HTMLDocument document) throws BadLocationException
operation
- the operation to accept. Must have been retrieved from this operation manager.document
- the document being edited. This must be the document retrieved from the HTML editing pane.
BadLocationException
- if the operation attempts to access or modify an invalid location in the document.void reject(Operation operation, HTMLDocument document) throws BadLocationException
operation
- the operation to reject. Must have been retrieved from this operation manager.document
- the document to reverse changes in. This must be the document retrieved from the HTML editing
pane.
BadLocationException
- if the operation attempts to access or modify an invalid location in the document.Operation nextOperation(Operation currentOperation)
currentOperation
- the operation to get the next operation after, or null
to get the first
operation in the document.
Operation
after currentOperation.Operation previousOperation(Operation currentOperation)
currentOperation
- the operation to get the operation before, or null
to get the last
operation in the document.
Operation
before currentOperation.Operation nextOperation(int afterOffset)
afterOffset
- the offset to find the closest operation after.
Operation previousOperation(int beforeOffset)
beforeOffset
- the offset to find the closest operation before.
Color getColorForUser(String author)
author
- the author to get the color for.
Color getColorForUser(Operation operation)
operation
- the operation to get the color for.
String getUsername()
void addOperationChangeListener(OperationListener listener)
listener
- the OperationListener
to receive eventsvoid removeOperationChangeListener(OperationListener listener)
listener
- the OperationListener
to remove.void removeOperation(Operation operation)
boolean isRemoved(int startOffset, int endOffset)
startOffset
- the start of the range.endOffset
- the end of the range.
true
if all text in the range is marked as removed, otherwise false
.String excludeRemovedWords(int offset, String text)
offset
- The offset of the text in the documenttext
- A piece of text from the document
|
Copyright (c) 2005-2012 Ephox Pty Ltd. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |