Enum ValidationStrategy

java.lang.Object
java.lang.Enum<ValidationStrategy>
org.netbeans.validation.api.ui.ValidationStrategy
All Implemented Interfaces:
Serializable, Comparable<ValidationStrategy>, java.lang.constant.Constable

public enum ValidationStrategy extends Enum<ValidationStrategy>
Determines what event on the component will trigger running validation. For example, if validation of a text component's content involves expensive calculation which could slow down the UI, you may want to use ON_FOCUS_LOSS; however ON_CHANGE_OR_ACTION (reacting every time a key is typed) provides more satisfactory user experience.
Author:
Tim Boudreau
  • Enum Constant Details

    • DEFAULT

      public static final ValidationStrategy DEFAULT
      Use whatever is generally most appropriate for this component
    • ON_FOCUS_LOSS

      public static final ValidationStrategy ON_FOCUS_LOSS
      Validate when focus is lost
    • ON_CHANGE_OR_ACTION

      public static final ValidationStrategy ON_CHANGE_OR_ACTION
      Validate on a document change or action performed or change event
    • INPUT_VERIFIER

      public static final ValidationStrategy INPUT_VERIFIER
      Validate using JComponent.setInputVerifier
  • Method Details

    • values

      public static ValidationStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ValidationStrategy valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null