Interface TextContext
-
@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface TextContext
Current Text Context where the text content iterator is positioned.- Since:
- 13
-
-
Field Summary
Fields Modifier and Type Field Description static int
EDITABLE
The returned text is in editable context.static int
EDITABLE_IN_FILTERED_CONDITIONAL_PROFILING
The returned text is in editable context but a profiling condition is applied and filters the node when the output will be published..static int
NOT_EDITABLE_IN_DELETE_CHANGE_TRACKING
The returned text is in delete change tracking context.static int
NOT_EDITABLE_IN_READ_ONLY
The returned text is in an entity or content reference.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getEditableState()
Check if we can edit at the current iterator offset.AuthorNode
getNode()
Get the parent node surrounding this text.java.lang.CharSequence
getText()
Gets the current text from the context.int
getTextEndOffset()
Gets the end offset of the returned text.int
getTextStartOffset()
Gets the start offset of the returned text.boolean
inSpacePreserve()
Check if the range is in a CSS white-space preserve context.boolean
inVisibleContent()
Check if the range is in visible content.void
replaceText(java.lang.CharSequence newTextContent)
Replaces the current context text with the new text content.
-
-
-
Field Detail
-
EDITABLE
static final int EDITABLE
The returned text is in editable context.- See Also:
- Constant Field Values
-
EDITABLE_IN_FILTERED_CONDITIONAL_PROFILING
static final int EDITABLE_IN_FILTERED_CONDITIONAL_PROFILING
The returned text is in editable context but a profiling condition is applied and filters the node when the output will be published..- See Also:
- Constant Field Values
-
NOT_EDITABLE_IN_DELETE_CHANGE_TRACKING
static final int NOT_EDITABLE_IN_DELETE_CHANGE_TRACKING
The returned text is in delete change tracking context.- See Also:
- Constant Field Values
-
NOT_EDITABLE_IN_READ_ONLY
static final int NOT_EDITABLE_IN_READ_ONLY
The returned text is in an entity or content reference.- See Also:
- Constant Field Values
-
-
Method Detail
-
getNode
AuthorNode getNode()
Get the parent node surrounding this text.- Returns:
- The node in which the text is located, never
null
- Since:
- 23
-
getText
java.lang.CharSequence getText()
Gets the current text from the context.- Returns:
- The current text from the context.
-
getTextStartOffset
int getTextStartOffset()
Gets the start offset of the returned text. The start offset is absolute in the Author Document's content.- Returns:
- The start offset of the returned text.
-
getTextEndOffset
int getTextEndOffset()
Gets the end offset of the returned text. The end offset is absolute in the Author Document's content.- Returns:
- The end offset of the returned text. It is exclusive.
-
getEditableState
int getEditableState()
Check if we can edit at the current iterator offset.- Returns:
- The returned value is one of the following constants:
EDITABLE
- text is in editable context.EDITABLE_IN_FILTERED_CONDITIONAL_PROFILING
- text is in editable context but a profiling condition is applied and filters the node when the output will be publishedNOT_EDITABLE_IN_READ_ONLY
- text is in an entity or content referenceNOT_EDITABLE_IN_DELETE_CHANGE_TRACKING
- text is in delete change tracking context
-
inVisibleContent
boolean inVisibleContent()
Check if the range is in visible content.- Returns:
true
if the range is in visible content.
-
inSpacePreserve
boolean inSpacePreserve()
Check if the range is in a CSS white-space preserve context.- Returns:
true
if the range is in space preserve context.- Since:
- 23
-
replaceText
void replaceText(java.lang.CharSequence newTextContent)
Replaces the current context text with the new text content.- Parameters:
newTextContent
- The new text content.
-
-