Class EntityComponentValidators

java.lang.Object
is.codion.swing.framework.ui.component.EntityComponentValidators

public final class EntityComponentValidators extends Object
A factory class for adding validators to components.
  • 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 validate
      textComponent - the text component
      editModel - 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 validate
      textComponent - the text component
      editModel - 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 validate
      textComponent - the text component
      editModel - the edit model
      defaultToolTip - 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 validate
      textComponent - the text component
      editModel - the edit model
      defaultToolTip - the tooltip to use while the value is valid