public class TextFieldSkin extends TextInputControlSkin<TextField>
Default skin implementation for the 
TextField control.- Since:
- 9
- See Also:
- TextField
- 
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 SummaryConstructors Constructor Description TextFieldSkin(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 Type Method Description 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.HitInfogetIndex(double x, double y)Performs a hit test, mapping point to index in the content.voidpositionCaret(HitInfo hit, boolean select)Moves the caret to the specified position.voidreplaceText(int start, int end, String txt)Replaces a range of characters with the given text.Methods declared in class javafx.scene.control.skin.TextInputControlSkinaddHighlight, forwardBiasProperty, getCharacterBounds, getClassCssMetaData, getHighlightFill, getHighlightTextFill, getInsertionPoint, getMenuPosition, getPromptTextFill, getRangeShape, getTextFill, getUnderlineShape, handleInputMethodEvent, highlightFillProperty, highlightTextFillProperty, invalidateMetrics, isForwardBias, maskText, moveCaret, promptTextFillProperty, removeHighlight, scrollCharacterToVisible, setCaretAnimating, setForwardBias, setHighlightFill, setHighlightTextFill, setPromptTextFill, setTextFill, textFillProperty, updateHighlightFill, updateHighlightTextFill, updateTextFillMethods declared in class javafx.scene.control.SkinBasecomputeBaselineOffset, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, consumeMouseEvents, executeAccessibleAction, getChildren, getCssMetaData, 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, unregisterListChangeListenersMethods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface javafx.scene.control.Skindispose, getNode, getSkinnable
- 
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- 
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:
- TextInputControl.replaceText(int, int, String)
 
- 
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.
 
 
-