Class EchoCharConverter

java.lang.Object
javafx.css.StyleConverter<String, Character>
com.dlsc.gemsfx.util.EchoCharConverter

public final class EchoCharConverter extends javafx.css.StyleConverter<String, Character>
A CSS StyleConverter that converts a single-character String CSS value into a Character.

This converter is used by EnhancedPasswordField to support the -fx-echo-char CSS property. The first character of the string is returned; if the value is null or empty, EnhancedPasswordField.DEFAULT_ECHO_CHAR is used instead.

Instances are obtained via the singleton accessor getInstance().

  • Nested Class Summary

    Nested classes/interfaces inherited from class javafx.css.StyleConverter

    javafx.css.StyleConverter.StringStore
  • Method Summary

    Modifier and Type
    Method
    Description
    convert(javafx.css.ParsedValue<String, Character> value, javafx.scene.text.Font font)
    Converts the parsed CSS value into an echo character.
    Returns the shared converter instance.
    Returns the name of this converter.

    Methods inherited from class javafx.css.StyleConverter

    cacheValue, clearCache, convert, getBooleanConverter, getCachedValue, getColorConverter, getDurationConverter, getEffectConverter, getEnumConverter, getFontConverter, getInsetsConverter, getPaintConverter, getSizeConverter, getStringConverter, getUrlConverter, readBinary, writeBinary

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • getInstance

      public static EchoCharConverter getInstance()
      Returns the shared converter instance.
      Returns:
      the shared converter instance
    • convert

      public Character convert(javafx.css.ParsedValue<String, Character> value, javafx.scene.text.Font font)
      Converts the parsed CSS value into an echo character.
      Overrides:
      convert in class javafx.css.StyleConverter<String, Character>
      Parameters:
      value - the parsed value
      font - the font in use
      Returns:
      the converted echo character
    • toString

      public String toString()
      Returns the name of this converter.
      Overrides:
      toString in class Object
      Returns:
      the converter name