TextEditingArea
| Modifier and Type | Method and Description |
|---|---|
| public Optional | allParToVisibleParIndex(int allParIndex)
Maps a paragraph index from |
| public BooleanProperty | |
| public ObjectProperty | |
| public DoubleProperty | |
| public DoubleProperty | |
| public BooleanProperty | |
| public Var | |
| public Var | |
| public default int | firstVisibleParToAllParIndex()
Returns the index of the first visible paragraph in the index system of |
| public BiConsumer | |
| public <T extends Node & Caret> Optional | getCaretBoundsOnScreen(T caret)
Using the paragraph index of the "all paragraph" index system, returns the bounds of a caret on the
given paragraph or |
| public Optional | Returns: the bounds orOptional#empty() if line is not visible or the range is only a newline character.the start position from, int the end position to)Gets the character bounds on screen |
| public default ContextMenu | |
| public default double | getContextMenuXOffset()
Gets the horizontal amount in pixels by which to offset the |
| public default double | getContextMenuYOffset()
Gets the vertical amount in pixels by which to offset the |
| public default Duration | getMouseOverTextDelay()
Defines how long the mouse has to stay still over the text before a
|
| public EventHandler | |
| public default Consumer | getOnNewSelectionDrag()
Runs the consumer when the mouse is dragged in this scenario: the user has pressed the mouse over some unselected text, and dragged the mouse to a new location within the area, but has not yet released the mouse. |
| public EventHandler | |
| public EventHandler | |
| public default Consumer | getOnSelectionDrag()
Runs the consumer when the mouse is dragged in this scenario: the user has selected some text, pressed the mouse on top of the selection, dragged it to a new location within the area, but has not yet released the mouse. |
| public EventHandler | |
| public Optional | getParagraphBoundsOnScreen(int
the index in area's list of paragraphs (visible and invisible). paragraphIndex)Returns the bounds of the paragraph if it is visible or |
| public default IntFunction | getParagraphGraphicFactory()
Gets the function that maps a line index to a node that is positioned to the left of the first character in a paragraph's text. |
| public int | getParagraphLinesCount(int paragraphIndex)
Gets the number of lines a paragraph spans when |
| public double | getViewportHeight()
Gets the height of the viewport and ignores the padding values added to the area. |
| public Bounds | getVisibleParagraphBoundsOnScreen(int
the index in area's list of visible paragraphs. visibleParagraphIndex)Returns the bounds of the paragraph if it is visible or |
| public LiveList | |
| public default void | |
| public CharacterHit | hit(double x, double y)
Helpful for determining which letter is at point x, y:
|
| public default boolean | isAutoScrollOnDragDesired()
Indicates whether area should auto scroll towards a |
| public default boolean | |
| public default boolean | isWrapText()
When a run of text exceeds the width of the text region, then this property indicates whether the text should wrap onto another line. |
| public default int | lastVisibleParToAllParIndex()
Returns the index of the last visible paragraph in the index system of |
| public void | lineEnd(NavigationActions.
use policyNavigationActions. when no selection is desired an
NavigationActions. when a selection from starting point
to the place to where the caret is moved is desired.Move the caret to the end of either the line in a multi-line wrapped paragraph or the paragraph in a single-line / non-wrapped paragraph |
| public int | lineIndex(int paragraphIndex, int columnPosition)
Returns 0 if the given paragraph displays its content across only one line, or returns the index of the line on which the given column position appears if the paragraph spans multiple lines. |
| public void | lineStart(NavigationActions.
use policyNavigationActions. when no selection is desired an
NavigationActions. when a selection from starting point
to the place to where the caret is moved is desired.Move the caret to the start of either the line in a multi-line wrapped paragraph or the paragraph in a single-line / non-wrapped paragraph |
| public ObjectProperty | |
| public void | nextPage(NavigationActions.
use selectionPolicyNavigationActions. when no selection is desired and
NavigationActions. when a selection from starting point
to the place to where the caret is moved is desired.Moves caret to the next page (i.e. page down) |
| public ObjectProperty | |
| public ObjectProperty | |
| public ObjectProperty | |
| public ObjectProperty | |
| public ObjectProperty | |
| public ObjectProperty | |
| public ObjectProperty | |
| public void | prevPage(NavigationActions.
use selectionPolicyNavigationActions. when no selection is desired and
NavigationActions. when a selection from starting point
to the place to where the caret is moved is desired.Moves caret to the previous page (i.e. page up) |
| public void | requestFollowCaret()
If the caret is not visible within the area's view, the area will scroll so that caret is visible in the next layout pass. |
| public default void | |
| public default void | |
| public default void | |
| public default void | |
| public default void | |
| public default void | |
| public default void | |
| public void | setOnInsideSelectionMousePressReleased(EventHandler<MouseEvent> handler)
Runs the EventHandler when the mouse is released in this scenario: the user has selected some text and then "clicked" the mouse somewhere in that selection (the use pressed the mouse, did not drag it, and released the mouse) Note this consumer is run on |
| public default void | |
| public void | setOnNewSelectionDragFinished(EventHandler<MouseEvent> handler)
Runs the EventHandler when the mouse is released in this scenario: the user has pressed the mouse over some unselected text, and dragged the mouse to a new location within the area, and released the mouse. |
| public void | setOnOutsideSelectionMousePressed(EventHandler<MouseEvent> handler)
Runs the EventHandler when the user pressed the mouse over unselected text within the area. |
| public default void | |
| public void | setOnSelectionDropped(EventHandler<MouseEvent> handler)
Runs the EventHandler when the mouse is released in this scenario: the user has selected some text, pressed the mouse on top of the selection, dragged it to a new location within the area, and released the mouse within the area. |
| public default void | |
| public default void | |
| public void | showParagraphAtBottom(int paragraphIndex)
Lays out the viewport so that the paragraph is the last line (bottom) displayed in the viewport. |
| public void | showParagraphAtTop(int paragraphIndex)
Lays out the viewport so that the paragraph is the first line (top) displayed in the viewport. |
| public void | |
| public void | showParagraphRegion(int paragraphIndex, Bounds region)
Lays out the viewport so that the given bounds (according to the paragraph's coordinate system) within the given paragraph is visible in the viewport. |
| public Val | |
| public Val | |
| public EventStream | viewportDirtyEvents()
Returns an |
| public int | visibleParToAllParIndex(int visibleParIndex)
Maps a paragraph index from |
| public BooleanProperty |
| allParToVisibleParIndex | back to summary |
|---|---|
| public Optional Maps a paragraph index from | |
| autoScrollOnDragDesiredProperty | back to summary |
|---|---|
| public BooleanProperty autoScrollOnDragDesiredProperty() | |
| contextMenuObjectProperty | back to summary |
|---|---|
| public ObjectProperty | |
| contextMenuXOffsetProperty | back to summary |
|---|---|
| public DoubleProperty contextMenuXOffsetProperty() | |
| contextMenuYOffsetProperty | back to summary |
|---|---|
| public DoubleProperty contextMenuYOffsetProperty() | |
| editableProperty | back to summary |
|---|---|
| public BooleanProperty editableProperty() | |
| estimatedScrollXProperty | back to summary |
|---|---|
| public Var The estimated scrollX value. This can be set in order to scroll the content. Value is only accurate when area does not wrap lines and uses the same font size throughout the entire area. | |
| estimatedScrollYProperty | back to summary |
|---|---|
| public Var The estimated scrollY value. This can be set in order to scroll the content. Value is only accurate when area does not wrap lines and uses the same font size throughout the entire area. | |
| firstVisibleParToAllParIndex | back to summary |
|---|---|
| public default int firstVisibleParToAllParIndex() Returns the index of the first visible paragraph in the index system of | |
| getApplyParagraphStyle | back to summary |
|---|---|
| public BiConsumer Gets the style applicator. | |
| getCaretBoundsOnScreen | back to summary |
|---|---|
| public <T extends Node & Caret> Optional Using the paragraph index of the "all paragraph" index system, returns the bounds of a caret on the
given paragraph or | |
| getCharacterBoundsOnScreen | back to summary |
|---|---|
| public Optional Gets the character bounds on screen
| |
| getContextMenu | back to summary |
|---|---|
| public default ContextMenu getContextMenu() Gets the | |
| getContextMenuXOffset | back to summary |
|---|---|
| public default double getContextMenuXOffset() Gets the horizontal amount in pixels by which to offset the | |
| getContextMenuYOffset | back to summary |
|---|---|
| public default double getContextMenuYOffset() Gets the vertical amount in pixels by which to offset the | |
| getMouseOverTextDelay | back to summary |
|---|---|
| public default Duration getMouseOverTextDelay() Defines how long the mouse has to stay still over the text before a
Default value is | |
| getOnInsideSelectionMousePressReleased | back to summary |
|---|---|
| public EventHandler | |
| getOnNewSelectionDrag | back to summary |
|---|---|
| public default Consumer Runs the consumer when the mouse is dragged in this scenario: the user has pressed the mouse over some unselected text, and dragged the mouse to a new location within the area, but has not yet released the mouse. Each time the user drags the mouse without releasing it, this hook's consumer gets called. By default, this will create a new selection or
.
| |
| getOnNewSelectionDragFinished | back to summary |
|---|---|
| public EventHandler | |
| getOnOutsideSelectionMousePressed | back to summary |
|---|---|
| public EventHandler | |
| getOnSelectionDrag | back to summary |
|---|---|
| public default Consumer Runs the consumer when the mouse is dragged in this scenario: the user has selected some text, pressed the mouse on top of the selection, dragged it to a new location within the area, but has not yet released the mouse. Each time the user drags the mouse without releasing it, this hook's consumer gets called. By default, this will .
| |
| getOnSelectionDropped | back to summary |
|---|---|
| public EventHandler | |
| getParagraphBoundsOnScreen | back to summary |
|---|---|
| public Optional Returns the bounds of the paragraph if it is visible or Note the bound's width will always equal the area's width, not necessarily the paragraph's real width (if it's short and doesn't take up all of the area's provided horizontal space or if it's long and spans outside of the area's width).
| |
| getParagraphGraphicFactory | back to summary |
|---|---|
| public default IntFunction Gets the function that maps a line index to a node that is positioned to the left of the first character
in a paragraph's text. Useful for toggle points or indicating the line's number via | |
| getParagraphLinesCount | back to summary |
|---|---|
| public int getParagraphLinesCount(int paragraphIndex) Gets the number of lines a paragraph spans when Caution the underlying TextFlow does not immediately account for changes in the stage's width when the
paragraph in question is a multi-line paragraph and | |
| getViewportHeight | back to summary |
|---|---|
| public double getViewportHeight() Gets the height of the viewport and ignores the padding values added to the area. | |
| getVisibleParagraphBoundsOnScreen | back to summary |
|---|---|
| public Bounds getVisibleParagraphBoundsOnScreen(int visibleParagraphIndex) Returns the bounds of the paragraph if it is visible or Note the bound's width will always equal the area's width, not necessarily the paragraph's real width (if it's short and doesn't take up all of the area's provided horizontal space or if it's long and spans outside of the area's width).
| |
| getVisibleParagraphs | back to summary |
|---|---|
| public LiveList Gets the visible paragraphs, even the ones that are barely displayed. | |
| hideContextMenu | back to summary |
|---|---|
| public default void hideContextMenu() Hides the area's context menu if it is not | |
| hit | back to summary |
|---|---|
| public CharacterHit hit(double x, double y) Helpful for determining which letter is at point x, y:
| |
| isAutoScrollOnDragDesired | back to summary |
|---|---|
| public default boolean isAutoScrollOnDragDesired() Indicates whether area should auto scroll towards a | |
| isEditable | back to summary |
|---|---|
| public default boolean isEditable() Indicates whether this text area can be edited by the user. Note that this property doesn't affect editing through the API. | |
| isWrapText | back to summary |
|---|---|
| public default boolean isWrapText() When a run of text exceeds the width of the text region, then this property indicates whether the text should wrap onto another line. | |
| lastVisibleParToAllParIndex | back to summary |
|---|---|
| public default int lastVisibleParToAllParIndex() Returns the index of the last visible paragraph in the index system of | |
| lineEnd | back to summary |
|---|---|
| public void lineEnd(NavigationActions. Move the caret to the end of either the line in a multi-line wrapped paragraph or the paragraph in a single-line / non-wrapped paragraph
| |
| lineIndex | back to summary |
|---|---|
| public int lineIndex(int paragraphIndex, int columnPosition) Returns 0 if the given paragraph displays its content across only one line, or returns the index of the line on which the given column position appears if the paragraph spans multiple lines. | |
| lineStart | back to summary |
|---|---|
| public void lineStart(NavigationActions. Move the caret to the start of either the line in a multi-line wrapped paragraph or the paragraph in a single-line / non-wrapped paragraph
| |
| mouseOverTextDelayProperty | back to summary |
|---|---|
| public ObjectProperty | |
| nextPage | back to summary |
|---|---|
| public void nextPage(NavigationActions. Moves caret to the next page (i.e. page down)
| |
| onInsideSelectionMousePressReleasedProperty | back to summary |
|---|---|
| public ObjectProperty | |
| onNewSelectionDragFinishedProperty | back to summary |
|---|---|
| public ObjectProperty | |
| onNewSelectionDragProperty | back to summary |
|---|---|
| public ObjectProperty | |
| onOutsideSelectionMousePressedProperty | back to summary |
|---|---|
| public ObjectProperty | |
| onSelectionDragProperty | back to summary |
|---|---|
| public ObjectProperty | |
| onSelectionDroppedProperty | back to summary |
|---|---|
| public ObjectProperty | |
| paragraphGraphicFactoryProperty | back to summary |
|---|---|
| public ObjectProperty | |
| prevPage | back to summary |
|---|---|
| public void prevPage(NavigationActions. Moves caret to the previous page (i.e. page up)
| |
| requestFollowCaret | back to summary |
|---|---|
| public void requestFollowCaret() If the caret is not visible within the area's view, the area will scroll so that caret is visible in the next layout pass. Use this method when you wish to "follow the caret" (i.e. auto-scroll to caret) after making a change (add/remove/modify area's segments). | |
| selectLine | back to summary |
|---|---|
| public default void selectLine() Selects the current line of a multi-line paragraph. | |
| setAutoScrollOnDragDesired | back to summary |
|---|---|
| public default void setAutoScrollOnDragDesired(boolean val) | |
| setContextMenu | back to summary |
|---|---|
| public default void setContextMenu(ContextMenu menu) | |
| setContextMenuXOffset | back to summary |
|---|---|
| public default void setContextMenuXOffset(double offset) | |
| setContextMenuYOffset | back to summary |
|---|---|
| public default void setContextMenuYOffset(double offset) | |
| setEditable | back to summary |
|---|---|
| public default void setEditable(boolean value) | |
| setMouseOverTextDelay | back to summary |
|---|---|
| public default void setMouseOverTextDelay(Duration delay) | |
| setOnInsideSelectionMousePressReleased | back to summary |
|---|---|
| public void setOnInsideSelectionMousePressReleased(EventHandler<MouseEvent> handler) Runs the EventHandler when the mouse is released in this scenario: the user has selected some text and then "clicked" the mouse somewhere in that selection (the use pressed the mouse, did not drag it, and released the mouse) Note this consumer is run on By default, this will .
| |
| setOnNewSelectionDrag | back to summary |
|---|---|
| public default void setOnNewSelectionDrag(Consumer<Point2D> consumer) | |
| setOnNewSelectionDragFinished | back to summary |
|---|---|
| public void setOnNewSelectionDragFinished(EventHandler<MouseEvent> handler) Runs the EventHandler when the mouse is released in this scenario: the user has pressed the mouse over some unselected text, and dragged the mouse to a new location within the area, and released the mouse. By default, this will .
| |
| setOnOutsideSelectionMousePressed | back to summary |
|---|---|
| public void setOnOutsideSelectionMousePressed(EventHandler<MouseEvent> handler) Runs the EventHandler when the user pressed the mouse over unselected text within the area. By default, this will .
| |
| setOnSelectionDrag | back to summary |
|---|---|
| public default void setOnSelectionDrag(Consumer<Point2D> consumer) | |
| setOnSelectionDropped | back to summary |
|---|---|
| public void setOnSelectionDropped(EventHandler<MouseEvent> handler) Runs the EventHandler when the mouse is released in this scenario: the user has selected some text, pressed the mouse on top of the selection, dragged it to a new location within the area, and released the mouse within the area. By default, this will relocate the selected text to the character index where the mouse was released via the code: .
| |
| setParagraphGraphicFactory | back to summary |
|---|---|
| public default void setParagraphGraphicFactory(IntFunction<? extends Node> factory) | |
| setWrapText | back to summary |
|---|---|
| public default void setWrapText(boolean value) | |
| showParagraphAtBottom | back to summary |
|---|---|
| public void showParagraphAtBottom(int paragraphIndex) Lays out the viewport so that the paragraph is the last line (bottom) displayed in the viewport. Note if
the given area does not have enough lines preceding the given line to span its entire height, the paragraph
may not appear at the very bottom of the viewport. Instead, it may appear towards the bottom of the viewport
with some extra space following it. For example, given an unwrapped area whose height could show 10 lines but
whose content only has 7 lines, calling | |
| showParagraphAtTop | back to summary |
|---|---|
| public void showParagraphAtTop(int paragraphIndex) Lays out the viewport so that the paragraph is the first line (top) displayed in the viewport. Note if
the given area does not have enough lines that follow the given line to span its entire height, the paragraph
may not appear at the very top of the viewport. Instead, it may simply be shown in the viewport. For example,
given an unwrapped area whose height could show 10 lines but whose content only has 3 lines, calling
| |
| showParagraphInViewport | back to summary |
|---|---|
| public void showParagraphInViewport(int paragraphIndex) Shows the paragraph somewhere in the viewport. If the line is already visible, no noticeable change occurs. If line is above the current view, it appears at the top of the viewport. If the line is below the current view, it appears at the bottom of the viewport. | |
| showParagraphRegion | back to summary |
|---|---|
| public void showParagraphRegion(int paragraphIndex, Bounds region) Lays out the viewport so that the given bounds (according to the paragraph's coordinate system) within the given paragraph is visible in the viewport. | |
| totalHeightEstimateProperty | back to summary |
|---|---|
| public Val The estimated height of the entire document. Accurate when area does not wrap lines and uses the same font size throughout the entire area. Value is only supposed to be set by the skin, not the user. | |
| totalWidthEstimateProperty | back to summary |
|---|---|
| public Val The estimated width of the entire document. Accurate when area does not wrap lines and uses the same font size throughout the entire area. Value is only supposed to be set by the skin, not the user. | |
| viewportDirtyEvents | back to summary |
|---|---|
| public EventStream Returns an | |
| visibleParToAllParIndex | back to summary |
|---|---|
| public int visibleParToAllParIndex(int visibleParIndex) Maps a paragraph index from | |
| wrapTextProperty | back to summary |
|---|---|
| public BooleanProperty wrapTextProperty() | |