Module is.codion.swing.framework.ui
Class EntityComponentValidators
java.lang.Object
is.codion.swing.framework.ui.component.EntityComponentValidators
A factory class for adding validators to components.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> void
addFormattedValidator
(Attribute<T> attribute, JTextComponent textComponent, EntityEditModel editModel) Adds a validator to the given text component, based on the given value link and edit modelstatic <T> void
addFormattedValidator
(Attribute<T> attribute, JTextComponent textComponent, EntityEditModel editModel, String defaultToolTip) Adds a validator to the given text component, based on the given value link and edit modelstatic <T> void
addValidator
(Attribute<T> attribute, JTextComponent textComponent, EntityEditModel editModel) Adds a validator to the given text component, based on the given value link and edit modelstatic <T> void
addValidator
(Attribute<T> attribute, JTextComponent textComponent, EntityEditModel editModel, String defaultToolTip) Adds a validator to the given text component, based on the given value link and edit model
-
Method Details
-
addValidator
public static <T> void addValidator(Attribute<T> attribute, JTextComponent textComponent, EntityEditModel editModel) Adds a validator to the given text component, based on the given value link and edit model- Type Parameters:
T
- the value type- Parameters:
attribute
- the attribute of the value to validatetextComponent
- the text componenteditModel
- the edit model
-
addFormattedValidator
public static <T> void addFormattedValidator(Attribute<T> attribute, JTextComponent textComponent, EntityEditModel editModel) Adds a validator to the given text component, based on the given value link and edit model- Type Parameters:
T
- the value type- Parameters:
attribute
- the attribute of the value to validatetextComponent
- the text componenteditModel
- the edit model
-
addValidator
public static <T> void addValidator(Attribute<T> attribute, JTextComponent textComponent, EntityEditModel editModel, String defaultToolTip) Adds a validator to the given text component, based on the given value link and edit model- Type Parameters:
T
- the value type- Parameters:
attribute
- the attribute of the value to validatetextComponent
- the text componenteditModel
- the edit modeldefaultToolTip
- the tooltip to use while the value is valid
-
addFormattedValidator
public static <T> void addFormattedValidator(Attribute<T> attribute, JTextComponent textComponent, EntityEditModel editModel, String defaultToolTip) Adds a validator to the given text component, based on the given value link and edit model- Type Parameters:
T
- the value type- Parameters:
attribute
- the attribute of the value to validatetextComponent
- the text componenteditModel
- the edit modeldefaultToolTip
- the tooltip to use while the value is valid
-