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:
  • Property Details Link icon

  • Constructor Details Link icon

    • TextInputControlSkin Link icon

      public 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.
      Parameters:
      control - The control that this skin should be installed onto.
  • Method Details Link icon

    • setTextFill Link icon

      protected final void setTextFill(Paint value)
      The fill Paint used for the foreground text color.
      Parameters:
      value - the text fill
    • getTextFill Link icon

      protected final Paint getTextFill()
      Gets the value of the textFill property.
      Property description:
      The fill to use for the text under normal conditions
      Returns:
      the value of the textFill property
      See Also:
    • textFillProperty Link icon

      protected final ObjectProperty<Paint> textFillProperty()
      The fill to use for the text under normal conditions
      Returns:
      the textFill property
      See Also:
    • setPromptTextFill Link icon

      protected final void setPromptTextFill(Paint value)
      The fill Paint used for the foreground prompt text color.
      Parameters:
      value - the prompt text fill
    • getPromptTextFill Link icon

      protected final Paint getPromptTextFill()
      Gets the value of the promptTextFill property.
      Property description:
      The fill Paint used for the foreground of prompt text.
      Returns:
      the value of the promptTextFill property
      See Also:
    • promptTextFillProperty Link icon

      protected final ObjectProperty<Paint> promptTextFillProperty()
      The fill Paint used for the foreground of prompt text.
      Returns:
      the promptTextFill property
      See Also:
    • setHighlightFill Link icon

      protected final void setHighlightFill(Paint value)
      The fill Paint used for the background of selected text.
      Parameters:
      value - the highlight fill
    • getHighlightFill Link icon

      protected final Paint getHighlightFill()
      Gets the value of the highlightFill property.
      Property description:
      The fill to use for the text when highlighted.
      Returns:
      the value of the highlightFill property
      See Also:
    • highlightFillProperty Link icon

      protected final ObjectProperty<Paint> highlightFillProperty()
      The fill to use for the text when highlighted.
      Returns:
      the highlightFill property
      See Also:
    • setHighlightTextFill Link icon

      protected final void setHighlightTextFill(Paint value)
      The fill Paint used for the foreground of selected text.
      Parameters:
      value - the highlight text fill
    • getHighlightTextFill Link icon

      protected final Paint getHighlightTextFill()
      Gets the value of the highlightTextFill property.
      Property description:
      The fill Paint used for the foreground of selected text.
      Returns:
      the value of the highlightTextFill property
      See Also:
    • highlightTextFillProperty Link icon

      protected final ObjectProperty<Paint> highlightTextFillProperty()
      The fill Paint used for the foreground of selected text.
      Returns:
      the highlightTextFill property
      See Also:
    • forwardBiasProperty Link icon

      protected final BooleanProperty forwardBiasProperty()
      Caret bias in the content. true means a bias towards forward character (true=leading/false=trailing)
      Returns:
      the forwardBias property
      See Also:
    • setForwardBias Link icon

      public final void setForwardBias(boolean isLeading)
      Sets the value of the forwardBias property.
      Property description:
      Caret bias in the content. true means a bias towards forward character (true=leading/false=trailing)
      Parameters:
      isLeading - the value for the forwardBias property
      See Also:
    • isForwardBias Link icon

      protected final boolean isForwardBias()
      Gets the value of the forwardBias property.
      Property description:
      Caret bias in the content. true means a bias towards forward character (true=leading/false=trailing)
      Returns:
      the value of the forwardBias property
      See Also:
    • getUnderlineShape Link icon

      protected abstract PathElement[] getUnderlineShape(int start, int end)
      Gets 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
    • getRangeShape Link icon

      protected abstract PathElement[] getRangeShape(int start, int end)
      Gets 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
    • addHighlight Link icon

      protected abstract void addHighlight(List<? extends Node> nodes, int start)
      Adds highlight for composed text from Input Method.
      Parameters:
      nodes - the list of nodes
      start - the start
    • removeHighlight Link icon

      protected abstract void removeHighlight(List<? extends Node> nodes)
      Removes highlight for composed text from Input Method.
      Parameters:
      nodes - the list of nodes
    • moveCaret Link icon

      public 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.
    • getMenuPosition Link icon

      public Point2D getMenuPosition()
      Returns 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
    • maskText Link icon

      protected String maskText(String txt)
      This 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.
    • getInsertionPoint Link icon

      protected 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
    • getCharacterBounds Link icon

      public Rectangle2D getCharacterBounds(int index)
      Returns the bounds of the character at a given index.
      Parameters:
      index - the index
      Returns:
      the bounds of the character at a given index
    • scrollCharacterToVisible Link icon

      protected void scrollCharacterToVisible(int index)
      Ensures that the character at a given index is visible.
      Parameters:
      index - the index
    • invalidateMetrics Link icon

      protected void invalidateMetrics()
      Invalidates cached min and pref sizes for the TextInputControl.
    • updateTextFill Link icon

      protected void updateTextFill()
      Called when textFill property changes.
    • updateHighlightFill Link icon

      protected void updateHighlightFill()
      Called when highlightFill property changes.
    • updateHighlightTextFill Link icon

      protected void updateHighlightTextFill()
      Called when highlightTextFill property changes.
    • handleInputMethodEvent Link icon

      protected void handleInputMethodEvent(InputMethodEvent event)
      Handles an input method event.
      Parameters:
      event - the InputMethodEvent to be handled
    • setCaretAnimating Link icon

      public 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.
    • getClassCssMetaData Link icon

      public static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
      Returns 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