org.netbeans.validation.api.ui
Enum ValidationStrategy

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

public enum ValidationStrategy
extends java.lang.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 Summary
Enum Constant and Description
DEFAULT
          Use whatever is generally most appropriate for this component
INPUT_VERIFIER
          Validate using JComponent.setInputVerifier
ON_CHANGE_OR_ACTION
          Validate on a document change or action performed or change event
ON_FOCUS_LOSS
          Validate when focus is lost
 
Method Summary
Modifier and Type Method and Description
static ValidationStrategy valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ValidationStrategy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

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 Detail

values

public static ValidationStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ValidationStrategy c : ValidationStrategy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ValidationStrategy valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null