TextEditingArea<PS,SEG,S>
CodeArea
, GenericStyledArea
, InlineCssTextArea
, InlineCssTextField
, StyleClassedTextArea
, StyleClassedTextField
, StyledTextArea
, StyledTextField
public interface NavigationActions<PS,SEG,S> extends TextEditingArea<PS,SEG,S>
TextEditingArea
.anchor, beingUpdated, caretBounds, caretColumn, caretPosition, currentParagraph, length, selectedText, selectionBounds, selection, showCaret, text
Modifier and Type | Interface | Description |
---|---|---|
static class |
NavigationActions.SelectionPolicy |
Indicates how to treat selection when caret is moved.
|
Modifier and Type | Method | 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 |
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) using the given selection policy. |
default void |
moveTo(int position,
NavigationActions.SelectionPolicy selectionPolicy) |
Moves the caret to the given position.
|
default void |
nextChar(NavigationActions.SelectionPolicy selectionPolicy) |
Moves the caret forward one char in the text.
|
default void |
paragraphEnd(NavigationActions.SelectionPolicy selectionPolicy) |
Moves the caret to the end of the current paragraph.
|
default void |
paragraphStart(NavigationActions.SelectionPolicy selectionPolicy) |
Moves the caret to the beginning of the current paragraph.
|
default void |
previousChar(NavigationActions.SelectionPolicy selectionPolicy) |
Moves the caret backward one char in the text.
|
default void |
selectAll() |
Selects everything in the area.
|
default void |
selectParagraph() |
Selects the current paragraph.
|
default void |
selectWord() |
Selects the word closest to the caret
|
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, beingUpdatedProperty, caretBoundsProperty, caretColumnProperty, caretPositionProperty, createMultiChange, createMultiChange, currentParagraphProperty, displaceCaret, dispose, getAbsolutePosition, getAnchor, getCaretBounds, getCaretColumn, getCaretPosition, getCaretSelectionBind, getContent, getCurrentParagraph, getDocument, getLength, getLocale, getParagraph, getParagraphLength, getParagraphs, getParagraphSelection, getParagraphSelection, getSegOps, getSelectedText, getSelection, getSelectionBounds, getShowCaret, getText, getText, getText, getText, getText, isBeingUpdated, lengthProperty, multiPlainChanges, multiRichChanges, plainTextChanges, replace, replace, replace, replace, replace, replace, replaceText, replaceText, replaceText, richChanges, selectedTextProperty, selectionBoundsProperty, selectionProperty, selectRange, selectRange, setShowCaret, showCaretProperty, subDocument, subDocument, subDocument, subDocument, textProperty
default 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 position, NavigationActions.SelectionPolicy selectionPolicy)
default void moveTo(int paragraphIndex, int columnIndex, NavigationActions.SelectionPolicy selectionPolicy)
getAbsolutePosition(paragraphIndex, columnIndex)
using the given selection policy.
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 selectWord()
default void paragraphStart(NavigationActions.SelectionPolicy selectionPolicy)
default void paragraphEnd(NavigationActions.SelectionPolicy selectionPolicy)
default void start(NavigationActions.SelectionPolicy selectionPolicy)
default void end(NavigationActions.SelectionPolicy selectionPolicy)
default void selectParagraph()
default void selectAll()
default void deselect()