TextAreaBase
The base class for TextArea and StyledTextArea.
The only difference between the two implementations :
The type of the document (TextDocument vs StyledTextDocument).
How the text is rendered.
StyledTextArea has additional methods to add/remove HighlightRanges.
Therefore, TextArea and StyledTextArea classes are quite small; most of the code is in this base class.
Inheritors
Properties
Along with caretPosition, this defines the extent of the selection. If anchorPosition == caretPosition, then nothing is selected.
The caret is the vertical flashing bar between two characters, where text can be typed. When text is selected, caretPosition can be either end of the selection. See selectionStartProperty and selectionEndProperty.
The base class Node has no children, so this is an empty list.
The behaviour for each Action in TextAreaActions.
The distance from the top of one line of text to the top of the next line, as a proportion of the font's height. i.e. 1 for the 'normal' distance. However, 1 looks a little cramped, and therefore 1.2 is often the 'standard' value.
Used to calculate the preferred width of this Node.
Used to calculate the preferred height of this Node.
The maximum of caretPosition and anchorPosition
The minimum of caretPosition and anchorPosition
TextArea does NOT store the document as a String, it is stored as a list of strings where each item in the list does NOT contain a new line character.
True iff caretPosition != anchorPosition
Functions
Each subclass of node can determine the minimum width it requires. This can be overridden on an ad-hoc basis using overrideMinHeight. The default implementation returns 0.
Each subclass of node can determine the minimum width it requires. This can be overridden on an ad-hoc basis using overrideMinWidth. The default implementation returns 0.
Each subclass of node can determine its preferred height. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.
Each subclass of node can determine its preferred width. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.
Replaces the text between anchorPosition and caretPosition with replacement text. The caret is advanced to the end of the replaced text.