Class PasswordTextFormatter

java.lang.Object
javafx.scene.control.TextFormatter<String>
atlantafx.base.util.PasswordTextFormatter

public class PasswordTextFormatter extends javafx.scene.control.TextFormatter<String>
An alternative to the PasswordField class. This formatter masks or unmasks text field content based on a boolean property.
  • Property Summary

    Properties
    Type
    Property
    Description
    javafx.beans.property.ReadOnlyStringProperty
    Always returns the unmasked password text regardless of the revealPasswordProperty() state.
    javafx.beans.property.BooleanProperty
    Specifies whether the unmasked password text is revealed or not.

    Properties inherited from class javafx.scene.control.TextFormatter

    value
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static class 
     
    protected static class 
     

    Nested classes/interfaces inherited from class javafx.scene.control.TextFormatter

    javafx.scene.control.TextFormatter.Change
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final char
     

    Fields inherited from class javafx.scene.control.TextFormatter

    IDENTITY_STRING_CONVERTER
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    PasswordTextFormatter(javafx.util.StringConverter<String> valueConverter, UnaryOperator<javafx.scene.control.TextFormatter.Change> filter, javafx.scene.control.TextField field, char bullet)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    create(javafx.scene.control.TextField textField)
    Creates a new password text formatter with the default mask character and applies itself to the specified text field.
    create(javafx.scene.control.TextField field, char bullet)
    Creates a new password text formatter with the provided mask character and applies itself to the specified text field.
    boolean
    javafx.beans.property.ReadOnlyStringProperty
    Always returns the unmasked password text regardless of the revealPasswordProperty() state.
    javafx.beans.property.BooleanProperty
    Specifies whether the unmasked password text is revealed or not.
    void
    setRevealPassword(boolean reveal)

    Methods inherited from class javafx.scene.control.TextFormatter

    getFilter, getValue, getValueConverter, setValue, valueProperty

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Property Details

  • Field Details

  • Constructor Details

    • PasswordTextFormatter

      protected PasswordTextFormatter(javafx.util.StringConverter<String> valueConverter, UnaryOperator<javafx.scene.control.TextFormatter.Change> filter, javafx.scene.control.TextField field, char bullet)
  • Method Details

    • passwordProperty

      public javafx.beans.property.ReadOnlyStringProperty passwordProperty()
      Always returns the unmasked password text regardless of the revealPasswordProperty() state.
      See Also:
    • getPassword

      public String getPassword()
    • revealPasswordProperty

      public javafx.beans.property.BooleanProperty revealPasswordProperty()
      Specifies whether the unmasked password text is revealed or not.
      See Also:
    • getRevealPassword

      public boolean getRevealPassword()
    • setRevealPassword

      public void setRevealPassword(boolean reveal)
    • create

      public static PasswordTextFormatter create(javafx.scene.control.TextField field, char bullet)
      Creates a new password text formatter with the provided mask character and applies itself to the specified text field.
    • create

      public static PasswordTextFormatter create(javafx.scene.control.TextField textField)
      Creates a new password text formatter with the default mask character and applies itself to the specified text field.