Module is.codion.plugin.flatlaf
Class FlatValidationIndicator
java.lang.Object
is.codion.plugin.flatlaf.indicator.FlatValidationIndicator
- All Implemented Interfaces:
ValidationIndicator
A FlatLaf based ValidationIndicator implementation, using the FlatLaf 'outline' client property.
FlatLaf carries a value for each of the two severities, FlatClientProperties.OUTLINE_ERROR and
FlatClientProperties.OUTLINE_WARNING, along with FlatClientProperties.OUTLINE_SUCCESS.
A success is not the absence of an error, an empty optional field being valid without being a success,
it is a state of its own, a repeated password matching or a code having been verified. It is thereby specified
per component, by way of an instance based on the success state: validationIndicator(new FlatValidationIndicator(success))
-
Field Summary
Fields inherited from interface is.codion.swing.common.ui.component.indicator.ValidationIndicator
INDICATOR_CLASS -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a newFlatValidationIndicator, one never indicating successFlatValidationIndicator(ObservableState success) Instantiates a newFlatValidationIndicator, indicating success while the given state is enabled, unless the value is invalid or warned, those taking precedence. -
Method Summary
Modifier and TypeMethodDescriptionvoidenable(JComponent component, ObservableState invalid, ObservableState warned) Enables the validation indicator for the given component
-
Constructor Details
-
FlatValidationIndicator
public FlatValidationIndicator()Instantiates a newFlatValidationIndicator, one never indicating success -
FlatValidationIndicator
Instantiates a newFlatValidationIndicator, indicating success while the given state is enabled, unless the value is invalid or warned, those taking precedence. Note that the success state applies to each component this indicator is enabled for, such an instance is meant for a single component.- Parameters:
success- the success state- See Also:
-
-
Method Details
-
enable
Description copied from interface:ValidationIndicatorEnables the validation indicator for the given component- Specified by:
enablein interfaceValidationIndicator- Parameters:
component- the componentinvalid- the invalid state observer, true while the value may not be savedwarned- the warned state observer, true while the value carries a warning. Independent ofinvalid, a value can be both, in which case the invalid presentation wins
-