Default skin implementation for the
TextArea
control.- Since:
- 9
- See Also:
-
Property Summary
Properties declared in class javafx.scene.control.skin.TextInputControlSkin
forwardBias, highlightFill, highlightTextFill, promptTextFill, textFill
-
Nested Class Summary
Nested classes/interfaces declared in class javafx.scene.control.skin.TextInputControlSkin
TextInputControlSkin.Direction, TextInputControlSkin.TextUnit
-
Constructor Summary
ConstructorDescriptionTextAreaSkin
(TextArea control) Creates a new TextAreaSkin instance, installing the necessary child nodes into the Controlchildren
list, as well as the necessary input mappings for handling key, mouse, etc events. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addHighlight
(List<? extends Node> nodes, int start) Adds highlight for composed text from Input Method.double
computeBaselineOffset
(double topInset, double rightInset, double bottomInset, double leftInset) Calculates the baseline offset based on the first managed child.Gets theBounds
of the caret of the skinnedTextArea
.getIndex
(double x, double y) Performs a hit test, mapping point to index in the content.protected PathElement[]
getRangeShape
(int start, int end) Gets the path elements describing the bounding rectangles for the given range of text.protected PathElement[]
getUnderlineShape
(int start, int end) Gets the path elements describing the shape of the underline for the given range.void
moveCaret
(TextInputControlSkin.TextUnit unit, TextInputControlSkin.Direction dir, boolean select) Moves the caret by one of the given text unit, in the given direction.void
positionCaret
(HitInfo hit, boolean select) Moves the caret to the specified position.protected void
removeHighlight
(List<? extends Node> nodes) Removes highlight for composed text from Input Method.Methods declared in class javafx.scene.control.skin.TextInputControlSkin
forwardBiasProperty, getCharacterBounds, getClassCssMetaData, getHighlightFill, getHighlightTextFill, getInsertionPoint, getMenuPosition, getPromptTextFill, getTextFill, handleInputMethodEvent, highlightFillProperty, highlightTextFillProperty, invalidateMetrics, isForwardBias, maskText, promptTextFillProperty, scrollCharacterToVisible, setCaretAnimating, setForwardBias, setHighlightFill, setHighlightTextFill, setPromptTextFill, setTextFill, textFillProperty, updateHighlightFill, updateHighlightTextFill, updateTextFill
Methods declared in class javafx.scene.control.SkinBase
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, consumeMouseEvents, dispose, executeAccessibleAction, getChildren, getCssMetaData, getNode, getSkinnable, layoutChildren, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, queryAccessibleAttribute, registerChangeListener, registerInvalidationListener, registerListChangeListener, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, unregisterChangeListeners, unregisterInvalidationListeners, unregisterListChangeListeners
-
Constructor Details
-
TextAreaSkin
Creates a new TextAreaSkin instance, installing the necessary child nodes into the Controlchildren
list, as well as the necessary input mappings for handling key, mouse, etc events.- Parameters:
control
- The control that this skin should be installed onto.
-
-
Method Details
-
getIndex
Performs a hit test, mapping point to index in the content.- Parameters:
x
- the x coordinate of the point.y
- the y coordinate of the point.- Returns:
- a
HitInfo
object describing the index and forward bias.
-
moveCaret
public void moveCaret(TextInputControlSkin.TextUnit unit, TextInputControlSkin.Direction dir, boolean select) Moves the caret by one of the given text unit, in the given direction. Note that only certain combinations are valid, depending on the implementing subclass.- Specified by:
moveCaret
in classTextInputControlSkin<TextArea>
- Parameters:
unit
- the unit of text to move by.dir
- the direction of movement.select
- whether to extends the selection to the new posititon.
-
getUnderlineShape
Gets the path elements describing the shape of the underline for the given range.- Specified by:
getUnderlineShape
in classTextInputControlSkin<TextArea>
- Parameters:
start
- the startend
- the end- Returns:
- the path elements describing the shape of the underline for the given range
-
getRangeShape
Gets the path elements describing the bounding rectangles for the given range of text.- Specified by:
getRangeShape
in classTextInputControlSkin<TextArea>
- Parameters:
start
- the startend
- the end- Returns:
- the path elements describing the bounding rectangles for the given range of text
-
addHighlight
Adds highlight for composed text from Input Method.- Specified by:
addHighlight
in classTextInputControlSkin<TextArea>
- Parameters:
nodes
- the list of nodesstart
- the start
-
removeHighlight
Removes highlight for composed text from Input Method.- Specified by:
removeHighlight
in classTextInputControlSkin<TextArea>
- Parameters:
nodes
- the list of nodes
-
getCaretBounds
Gets theBounds
of the caret of the skinnedTextArea
.- Returns:
- the
Bounds
of the caret shape, relative to theTextArea
.
-
computeBaselineOffset
public double computeBaselineOffset(double topInset, double rightInset, double bottomInset, double leftInset) Calculates the baseline offset based on the first managed child. If there is no such child, returnsNode.getBaselineOffset()
.- Overrides:
computeBaselineOffset
in classSkinBase<TextArea>
- Parameters:
topInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left inset- Returns:
- baseline offset
-
positionCaret
Moves the caret to the specified position.- Parameters:
hit
- the new position and forward bias of the caret.select
- whether to extend selection to the new position.
-