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
FieldsModifier and TypeFieldDescriptionstatic final int
The returned text is in editable context.static final int
The returned text is in editable context but a profiling condition is applied and filters the node when the output will be published..static final int
The returned text is in delete change tracking context.static final int
The returned text is in an entity or content reference. -
Method Summary
Modifier and TypeMethodDescriptionint
Check if we can edit at the current iterator offset.getNode()
Get the parent node surrounding this text.getText()
Gets the current text from the context.int
Gets the end offset of the returned text.int
Gets the start offset of the returned text.boolean
Check if the range is in a CSS white-space preserve context.boolean
Check if the range is in visible content.void
replaceText
(CharSequence newTextContent) Replaces the current context text with the new text content.
-
Field Details
-
EDITABLE
static final int EDITABLEThe returned text is in editable context.- See Also:
-
EDITABLE_IN_FILTERED_CONDITIONAL_PROFILING
static final int EDITABLE_IN_FILTERED_CONDITIONAL_PROFILINGThe returned text is in editable context but a profiling condition is applied and filters the node when the output will be published..- See Also:
-
NOT_EDITABLE_IN_DELETE_CHANGE_TRACKING
static final int NOT_EDITABLE_IN_DELETE_CHANGE_TRACKINGThe returned text is in delete change tracking context.- See Also:
-
NOT_EDITABLE_IN_READ_ONLY
static final int NOT_EDITABLE_IN_READ_ONLYThe returned text is in an entity or content reference.- See Also:
-
-
Method Details
-
getNode
AuthorNode getNode()Get the parent node surrounding this text.- Returns:
- The node in which the text is located, never
null
- Since:
- 23
-
getText
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
Replaces the current context text with the new text content.- Parameters:
newTextContent
- The new text content.
-