Module javafx.controls
Package javafx.scene.control.skin
Class TextInputControlSkin<T extends TextInputControl>
java.lang.Object
javafx.scene.control.SkinBase<T>
javafx.scene.control.skin.TextInputControlSkin<T>
- All Implemented Interfaces:
- Skin<T>
- Direct Known Subclasses:
- TextAreaSkin,- TextFieldSkin
public abstract class TextInputControlSkin<T extends TextInputControl> extends SkinBase<T>
Abstract base class for text input skins.
- Since:
- 9
- See Also:
- TextFieldSkin,- TextAreaSkin
- 
Property SummaryProperties Type Property Description protected BooleanPropertyforwardBiasCaret bias in the content.protected ObjectProperty<Paint>highlightFillThe fill to use for the text when highlighted.protected ObjectProperty<Paint>highlightTextFillThe fillPaintused for the foreground of selected text.protected ObjectProperty<Paint>promptTextFillThe fillPaintused for the foreground of prompt text.protected ObjectProperty<Paint>textFillThe fill to use for the text under normal conditions
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classTextInputControlSkin.DirectionDirection names for caret movement.static classTextInputControlSkin.TextUnitUnit names for caret movement.
- 
Constructor SummaryConstructors Constructor Description TextInputControlSkin(T control)Creates a new instance of TextInputControlSkin, although note that this instance does not handle any behavior / input mappings - this needs to be handled appropriately by subclasses.
- 
Method SummaryModifier and Type Method Description protected abstract voidaddHighlight(List<? extends Node> nodes, int start)Adds highlight for composed text from Input Method.protected BooleanPropertyforwardBiasProperty()Caret bias in the content.Rectangle2DgetCharacterBounds(int index)Returns the bounds of the character at a given index.static List<CssMetaData<? extends Styleable,?>>getClassCssMetaData()Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.protected PaintgetHighlightFill()Gets the value of the property highlightFill.protected PaintgetHighlightTextFill()Gets the value of the property highlightTextFill.protected intgetInsertionPoint(double x, double y)Returns the insertion point for a given location.Point2DgetMenuPosition()Returns the position to be used for a context menu, based on the location of the caret handle or selection handles.protected PaintgetPromptTextFill()Gets the value of the property promptTextFill.protected abstract PathElement[]getRangeShape(int start, int end)Gets the path elements describing the bounding rectangles for the given range of text.protected PaintgetTextFill()Gets the value of the property textFill.protected abstract PathElement[]getUnderlineShape(int start, int end)Gets the path elements describing the shape of the underline for the given range.protected voidhandleInputMethodEvent(InputMethodEvent event)Handles an input method event.protected ObjectProperty<Paint>highlightFillProperty()The fill to use for the text when highlighted.protected ObjectProperty<Paint>highlightTextFillProperty()The fillPaintused for the foreground of selected text.protected voidinvalidateMetrics()Invalidates cached min and pref sizes for the TextInputControl.protected booleanisForwardBias()Gets the value of the property forwardBias.protected StringmaskText(String txt)This method may be overridden by subclasses to replace the displayed characters without affecting the actual text content.abstract voidmoveCaret(TextInputControlSkin.TextUnit unit, TextInputControlSkin.Direction dir, boolean select)Moves the caret by one of the given text unit, in the given direction.protected ObjectProperty<Paint>promptTextFillProperty()The fillPaintused for the foreground of prompt text.protected abstract voidremoveHighlight(List<? extends Node> nodes)Removes highlight for composed text from Input Method.protected voidscrollCharacterToVisible(int index)Ensures that the character at a given index is visible.voidsetCaretAnimating(boolean value)Starts or stops caret blinking.voidsetForwardBias(boolean isLeading)Sets the value of the property forwardBias.protected voidsetHighlightFill(Paint value)The fillPaintused for the background of selected text.protected voidsetHighlightTextFill(Paint value)The fillPaintused for the foreground of selected text.protected voidsetPromptTextFill(Paint value)The fillPaintused for the foreground prompt text color.protected voidsetTextFill(Paint value)The fillPaintused for the foreground text color.protected ObjectProperty<Paint>textFillProperty()The fill to use for the text under normal conditionsprotected voidupdateHighlightFill()Called when highlightFill property changes.protected voidupdateHighlightTextFill()Called when highlightTextFill property changes.protected voidupdateTextFill()Called when textFill property changes.Methods 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
- 
Property Details- 
textFillThe fill to use for the text under normal conditions- See Also:
- getTextFill(),- setTextFill(Paint)
 
- 
promptTextFillThe fillPaintused for the foreground of prompt text.- See Also:
- getPromptTextFill(),- setPromptTextFill(Paint)
 
- 
highlightFillThe fill to use for the text when highlighted.- See Also:
- getHighlightFill(),- setHighlightFill(Paint)
 
- 
highlightTextFillThe fillPaintused for the foreground of selected text.
- 
forwardBiasCaret bias in the content. true means a bias towards forward character (true=leading/false=trailing)- See Also:
- isForwardBias(),- setForwardBias(boolean)
 
 
- 
- 
Constructor Details- 
TextInputControlSkinCreates a new instance of TextInputControlSkin, although note that this instance does not handle any behavior / input mappings - this needs to be handled appropriately by subclasses.- Parameters:
- control- The control that this skin should be installed onto.
 
 
- 
- 
Method Details- 
setTextFillThe fillPaintused for the foreground text color.- Parameters:
- value- the text fill
 
- 
getTextFillGets the value of the property textFill.- Property description:
- The fill to use for the text under normal conditions
 
- 
textFillPropertyThe fill to use for the text under normal conditions- See Also:
- getTextFill(),- setTextFill(Paint)
 
- 
setPromptTextFillThe fillPaintused for the foreground prompt text color.- Parameters:
- value- the prompt text fill
 
- 
getPromptTextFillGets the value of the property promptTextFill.- Property description:
- The fill Paintused for the foreground of prompt text.
 
- 
promptTextFillPropertyThe fillPaintused for the foreground of prompt text.- See Also:
- getPromptTextFill(),- setPromptTextFill(Paint)
 
- 
setHighlightFillThe fillPaintused for the background of selected text.- Parameters:
- value- the highlight fill
 
- 
getHighlightFillGets the value of the property highlightFill.- Property description:
- The fill to use for the text when highlighted.
 
- 
highlightFillPropertyThe fill to use for the text when highlighted.- See Also:
- getHighlightFill(),- setHighlightFill(Paint)
 
- 
setHighlightTextFillThe fillPaintused for the foreground of selected text.- Parameters:
- value- the highlight text fill
 
- 
getHighlightTextFillGets the value of the property highlightTextFill.- Property description:
- The fill Paintused for the foreground of selected text.
 
- 
highlightTextFillPropertyThe fillPaintused for the foreground of selected text.
- 
forwardBiasPropertyCaret bias in the content. true means a bias towards forward character (true=leading/false=trailing)- See Also:
- isForwardBias(),- setForwardBias(boolean)
 
- 
setForwardBiaspublic final void setForwardBias(boolean isLeading)Sets the value of the property forwardBias.- Property description:
- Caret bias in the content. true means a bias towards forward character (true=leading/false=trailing)
 
- 
isForwardBiasprotected final boolean isForwardBias()Gets the value of the property forwardBias.- Property description:
- Caret bias in the content. true means a bias towards forward character (true=leading/false=trailing)
 
- 
getUnderlineShapeGets the path elements describing the shape of the underline for the given range.- 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.- 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.- Parameters:
- nodes- the list of nodes
- start- the start
 
- 
removeHighlightRemoves highlight for composed text from Input Method.- Parameters:
- nodes- the list of nodes
 
- 
moveCaretpublic abstract 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.- Parameters:
- unit- the unit of text to move by.
- dir- the direction of movement.
- select- whether to extends the selection to the new posititon.
 
- 
getMenuPositionReturns the position to be used for a context menu, based on the location of the caret handle or selection handles. This is supported only on touch displays and does not use the location of the mouse.- Returns:
- the position to be used for this context menu
 
- 
maskTextThis method may be overridden by subclasses to replace the displayed characters without affecting the actual text content. This is used to display bullet characters in PasswordField.- Parameters:
- txt- the content that may need to be masked.
- Returns:
- the replacement string. This may just be the input string, or may be a string of replacement characters with the same length as the input string.
 
- 
getInsertionPointprotected int getInsertionPoint(double x, double y)Returns the insertion point for a given location.- Parameters:
- x- the x location
- y- the y location
- Returns:
- the insertion point for a given location
 
- 
getCharacterBoundsReturns the bounds of the character at a given index.- Parameters:
- index- the index
- Returns:
- the bounds of the character at a given index
 
- 
scrollCharacterToVisibleprotected void scrollCharacterToVisible(int index)Ensures that the character at a given index is visible.- Parameters:
- index- the index
 
- 
invalidateMetricsprotected void invalidateMetrics()Invalidates cached min and pref sizes for the TextInputControl.
- 
updateTextFillprotected void updateTextFill()Called when textFill property changes.
- 
updateHighlightFillprotected void updateHighlightFill()Called when highlightFill property changes.
- 
updateHighlightTextFillprotected void updateHighlightTextFill()Called when highlightTextFill property changes.
- 
handleInputMethodEventHandles an input method event.- Parameters:
- event- the- InputMethodEventto be handled
 
- 
setCaretAnimatingpublic void setCaretAnimating(boolean value)Starts or stops caret blinking. The behavior classes use this to temporarily pause blinking while user is typing or otherwise moving the caret.- Parameters:
- value- whether caret should be blinking.
 
- 
getClassCssMetaDataReturns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.- Returns:
- the CssMetaData associated with this class, which may include the CssMetaData of its superclasses
 
 
-