Default skin implementation for the 
TextField control.- Since:
- 9
- See Also:
- 
Property SummaryProperties declared in class javafx.scene.control.skin.TextInputControlSkinforwardBias, highlightFill, highlightTextFill, promptTextFill, textFill
- 
Nested Class SummaryNested classes/interfaces declared in class javafx.scene.control.skin.TextInputControlSkinTextInputControlSkin.Direction, TextInputControlSkin.TextUnit
- 
Constructor SummaryConstructorsConstructorDescriptionTextFieldSkin(TextField control) Creates a new TextFieldSkin instance, installing the necessary child nodes into the Controlchildrenlist, as well as the necessary input mappings for handling key, mouse, etc events.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddHighlight(List<? extends Node> nodes, int start) Adds highlight for composed text from Input Method.doublecomputeBaselineOffset(double topInset, double rightInset, double bottomInset, double leftInset) Calculates the baseline offset based on the first managed child.voiddeleteChar(boolean previous) Deletes the character that follows or precedes the current caret position from the text if there is no selection, or deletes the selection if there is one.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.voidmoveCaret(TextInputControlSkin.TextUnit unit, TextInputControlSkin.Direction dir, boolean select) Moves the caret by one of the given text unit, in the given direction.voidpositionCaret(HitInfo hit, boolean select) Moves the caret to the specified position.protected voidremoveHighlight(List<? extends Node> nodes) Removes highlight for composed text from Input Method.voidreplaceText(int start, int end, String txt) Replaces a range of characters with the given text.Methods declared in class javafx.scene.control.skin.TextInputControlSkinforwardBiasProperty, 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, updateTextFillMethods declared in class javafx.scene.control.SkinBasecomputeMaxHeight, 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- 
TextFieldSkinCreates a new TextFieldSkin instance, installing the necessary child nodes into the Controlchildrenlist, 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- 
computeBaselineOffsetpublic 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:
- computeBaselineOffsetin class- SkinBase<TextField>
- Parameters:
- topInset- the pixel snapped top inset
- rightInset- the pixel snapped right inset
- bottomInset- the pixel snapped bottom inset
- leftInset- the pixel snapped left inset
- Returns:
- baseline offset
 
- 
replaceTextReplaces a range of characters with the given text. Call this implementation from behavior classes instead of the one provided on TextInputControl to ensure that the text scrolls as needed.- Parameters:
- start- The starting index in the range, inclusive. This must be >= 0 and < the end.
- end- The ending index in the range, exclusive. This is one-past the last character to delete (consistent with the String manipulation methods). This must be > the start, and <= the length of the text.
- txt- The text that is to replace the range. This must not be null.
- See Also:
 
- 
deleteCharpublic void deleteChar(boolean previous) Deletes the character that follows or precedes the current caret position from the text if there is no selection, or deletes the selection if there is one. Call this implementation from behavior classes instead of the one provided on TextInputControl to ensure that the text scrolls as needed.- Parameters:
- previous- whether to delete the preceding character.
 
- 
getIndexPerforms 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 HitInfoobject describing the index and forward bias.
 
- 
positionCaretMoves 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.
 
- 
getUnderlineShapeGets the path elements describing the shape of the underline for the given range.- Specified by:
- getUnderlineShapein class- TextInputControlSkin<TextField>
- Parameters:
- start- the start
- end- the end
- Returns:
- the path elements describing the shape of the underline for the given range
 
- 
getRangeShapeGets the path elements describing the bounding rectangles for the given range of text.- Specified by:
- getRangeShapein class- TextInputControlSkin<TextField>
- Parameters:
- start- the start
- end- the end
- Returns:
- the path elements describing the bounding rectangles for the given range of text
 
- 
addHighlightAdds highlight for composed text from Input Method.- Specified by:
- addHighlightin class- TextInputControlSkin<TextField>
- Parameters:
- nodes- the list of nodes
- start- the start
 
- 
removeHighlightRemoves highlight for composed text from Input Method.- Specified by:
- removeHighlightin class- TextInputControlSkin<TextField>
- Parameters:
- nodes- the list of nodes
 
- 
moveCaretpublic 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:
- moveCaretin class- TextInputControlSkin<TextField>
- Parameters:
- unit- the unit of text to move by.
- dir- the direction of movement.
- select- whether to extends the selection to the new posititon.
 
 
-