public interface NavigationActions<PS,S> extends TextEditingArea<PS,S>
TextEditingArea.anchor, caretColumn, caretPosition, currentParagraph, length, selectedText, selection, text| Modifier and Type | Interface and Description |
|---|---|
static class |
NavigationActions.SelectionPolicy
Indicates how to treat selection when caret is moved.
|
| Modifier and Type | Method and Description |
|---|---|
default void |
deselect()
Clears the selection while keeping the caret position.
|
default void |
end(NavigationActions.SelectionPolicy selectionPolicy)
Moves the caret to the end of the text.
|
default void |
lineEnd(NavigationActions.SelectionPolicy selectionPolicy)
Moves the caret to the end of the current line.
|
default void |
lineStart(NavigationActions.SelectionPolicy selectionPolicy)
Moves the caret to the beginning of the current line.
|
default void |
moveTo(int pos)
Moves the caret to the given position in the text
and clears any selection.
|
default void |
moveTo(int paragraphIndex,
int columnIndex)
Moves the caret to the position returned from
getAbsolutePosition(paragraphIndex, columnIndex)
and clears any selection. |
default void |
moveTo(int paragraphIndex,
int columnIndex,
NavigationActions.SelectionPolicy selectionPolicy)
Moves the caret to the position returned from
getAbsolutePosition(paragraphIndex, columnIndex). |
default void |
moveTo(int pos,
NavigationActions.SelectionPolicy selectionPolicy)
Moves the caret to the position indicated by
pos. |
default void |
nextChar(NavigationActions.SelectionPolicy selectionPolicy)
Moves the caret forward one char in the text.
|
default void |
previousChar(NavigationActions.SelectionPolicy selectionPolicy)
Moves the caret backward one char in the text.
|
default void |
selectAll()
Selects all text in the text input.
|
default void |
selectLine()
Selects the current line.
|
default void |
start(NavigationActions.SelectionPolicy selectionPolicy)
Moves the caret to the beginning of the text.
|
default void |
wordBreaksBackwards(int n,
NavigationActions.SelectionPolicy selectionPolicy)
Skips n number of word boundaries backwards.
|
default void |
wordBreaksForwards(int n,
NavigationActions.SelectionPolicy selectionPolicy)
Skips n number of word boundaries forward.
|
anchorProperty, caretColumnProperty, caretPositionProperty, currentParagraphProperty, getAbsolutePosition, getAnchor, getCaretColumn, getCaretPosition, getCurrentParagraph, getDocument, getLength, getParagraphs, getSelectedText, getSelection, getText, getText, getText, getText, lengthProperty, plainTextChanges, positionCaret, replace, replace, replace, replaceText, replaceText, replaceText, richChanges, selectedTextProperty, selectionProperty, selectRange, selectRange, subDocument, subDocument, subDocument, textPropertydefault void moveTo(int pos)
default void moveTo(int paragraphIndex,
int columnIndex)
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...
moveTo(0, 4) results in "Some|_Text" (caret to the left of "_")moveTo(1, -1) results in "Some|_Text" (caret in the left of "_")moveTo(1, 0) results in "Some_|Text" (caret in the left of "T")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.
paragraphIndex - the index of the paragraph to which to move the caretcolumnIndex - the index to the left of which to move the caretdefault void moveTo(int pos,
NavigationActions.SelectionPolicy selectionPolicy)
pos.
Based on the selection policy, the selection is either cleared
(i.e. anchor is set to the same position as caret), adjusted
(i.e. anchor is not moved at all), or extended
(i.e. pos becomes the new caret and, if pos points
outside the current selection, the far end of the current selection
becomes the anchor.default void moveTo(int paragraphIndex,
int columnIndex,
NavigationActions.SelectionPolicy selectionPolicy)
getAbsolutePosition(paragraphIndex, columnIndex).
Based on the selection policy, the selection is either cleared
(i.e. anchor is set to the same position as caret), adjusted
(i.e. anchor is not moved at all), or extended
(i.e. getAbsolutePosition(paragraphIndex, columnIndex becomes
the new caret and, if that returned value points outside the current selection,
the far end of the current selection becomes the anchor.
Caution: see TextEditingArea.getAbsolutePosition(int, int) to know how the column index argument
can affect the returned position.
default void previousChar(NavigationActions.SelectionPolicy selectionPolicy)
default void nextChar(NavigationActions.SelectionPolicy selectionPolicy)
default void wordBreaksBackwards(int n,
NavigationActions.SelectionPolicy selectionPolicy)
default void wordBreaksForwards(int n,
NavigationActions.SelectionPolicy selectionPolicy)
default void lineStart(NavigationActions.SelectionPolicy selectionPolicy)
default void lineEnd(NavigationActions.SelectionPolicy selectionPolicy)
default void start(NavigationActions.SelectionPolicy selectionPolicy)
default void end(NavigationActions.SelectionPolicy selectionPolicy)
default void selectLine()
default void selectAll()
default void deselect()