- 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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanisValid()default voidupdateInvalid(Node node, boolean invalid) Convenience method to update the ":invalid" PseudoClass offered by this interface.default List<Constraint>validate()
-
Field Details
-
INVALID_PSEUDO_CLASS
-
-
Method Details
-
getValidator
MFXValidator getValidator()- Returns:
- the
MFXValidatorinstance of this control
-
isValid
default boolean isValid()- Returns:
- whether the validator instance of this control is not null and valid
- See Also:
-
validate
- Returns:
- the list of invalid constraints for the control's validator instance.
An empty list if null
- See Also:
-
updateInvalid
Convenience method to update the ":invalid" PseudoClass offered by this interface.- Parameters:
node- the node on which apply/remove the ":invalid" PseudoClassinvalid- the PseudoClass state
-