Module MaterialFX

Interface Validated

All Known Implementing Classes:
MFXComboBox, MFXDatePicker, MFXFilterComboBox, MFXLegacyComboBox, MFXPasswordField, MFXStepperToggle, MFXTextField

public interface Validated
Interface that defines the public API every control needing validation should implement.

Note that this interface just tells the user that the control already offers a MFXValidator instance if needed.

Also defines a PseudoClass, ":invalid", that can be used in CSS to style the control according to the validator' state. Note that the PseudoClass is not managed automatically but it must be activated/deactivated by the user, you can use updateInvalid(Node, boolean) to do this.

  • Field Details

    • INVALID_PSEUDO_CLASS

      static final PseudoClass INVALID_PSEUDO_CLASS
  • Method Details

    • getValidator

      MFXValidator getValidator()
      Returns:
      the MFXValidator instance of this control
    • isValid

      default boolean isValid()
      Returns:
      whether the validator instance of this control is not null and valid
      See Also:
    • validate

      default List<Constraint> validate()
      Returns:
      the list of invalid constraints for the control's validator instance.

      An empty list if null

      See Also:
    • updateInvalid

      default void updateInvalid(Node node, boolean invalid)
      Convenience method to update the ":invalid" PseudoClass offered by this interface.
      Parameters:
      node - the node on which apply/remove the ":invalid" PseudoClass
      invalid - the PseudoClass state