Interface NavigationActions<PS,​SEG,​S>

    • Method Detail

      • moveTo

        default void moveTo​(int pos)
        Moves the caret to the given position in the text and clears any selection.
      • moveTo

        default void moveTo​(int paragraphIndex,
                            int columnIndex)
        Moves the caret to the position returned from getAbsolutePosition(paragraphIndex, columnIndex) and clears any selection.

        For example, if "|" represents the caret, "_" represents a newline character, and given the text "Some_Text" (1st line: 'Some'; 2nd line 'Text'), then...

        • calling moveTo(0, 4) results in "Some|_Text" (caret to the left of "_")
        • calling moveTo(1, -1) results in "Some|_Text" (caret in the left of "_")
        • calling moveTo(1, 0) results in "Some_|Text" (caret in the left of "T")
        • calling moveTo(0, 5) results in "Some_|Text" (caret in the left of "T")

        Caution: see TextEditingArea.getAbsolutePosition(int, int) to know how the column index argument can affect the returned position.

        Parameters:
        paragraphIndex - the index of the paragraph to which to move the caret
        columnIndex - the index to the left of which to move the caret
      • selectWord

        default void selectWord()
        Selects the word closest to the caret
      • selectParagraph

        default void selectParagraph()
        Selects the current paragraph.
      • selectAll

        default void selectAll()
        Selects everything in the area.
      • deselect

        default void deselect()
        Clears the selection while keeping the caret position.