Class MoveCaretUtil

java.lang.Object
ro.sync.ecss.extensions.commons.operations.MoveCaretUtil

@API(type=INTERNAL, src=PUBLIC) public final class MoveCaretUtil extends Object
Utility to detect an editor variable in the Author page and move the caret to that place.
  • Method Details

    • hasImposedEditorVariableCaretOffset

      public static boolean hasImposedEditorVariableCaretOffset(String xmlFragment)
      Check if the imposed editor variable caret offset can be found in the XML fragment.
      Parameters:
      xmlFragment - The XML fragment.
      Returns:
      true if the imposed editor variable caret offset can be found in the XML fragment.
    • moveCaretToImposedEditorVariableOffset

      public static void moveCaretToImposedEditorVariableOffset(AuthorAccess authorAccess, int insertionOffset)
      Move the caret to the offset imposed by a certain editor variable present in the Author page.
      Parameters:
      authorAccess - The author access.
      insertionOffset - The offset where the operation inserted the XML fragment.