Interface TextContext


@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface TextContext
Current Text Context where the text content iterator is positioned.
Since:
13
  • Field Details

    • EDITABLE

      static final int EDITABLE
      The returned text is in editable context.
      See Also:
    • 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:
    • 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:
    • 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:
  • 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:
    • 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(CharSequence newTextContent)
      Replaces the current context text with the new text content.
      Parameters:
      newTextContent - The new text content.