public abstract class ValidationListener
extends javax.swing.InputVerifier
implements java.util.EventListener
Note that one validation listener may not belong to more than one ValidationGroup.
When an event that should trigger validation occurs, call the validate() method.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLIENT_PROP_NAME
Client property which can be set to provide a component's name for use
in validation messages.
|
Constructor and Description |
---|
ValidationListener() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
nameForComponent(javax.swing.JComponent jc)
Get a string name for a component using the following strategy:
Check
jc.getClientProperty(CLIENT_PROP_NAME)
If that returned null, call jc.getName()
|
static void |
setComponentName(javax.swing.JComponent comp,
java.lang.String localizedName) |
protected boolean |
validate()
Perform the validation logic, triggering a call to
Validate(Problems).
|
protected abstract boolean |
validate(Problems problems)
Perform the validation.
|
boolean |
verify(javax.swing.JComponent input)
Implementation of InputVerifier.
|
public static final java.lang.String CLIENT_PROP_NAME
getName()
method is used.protected abstract boolean validate(Problems problems)
Typically you will not call this method yourself; rather, the
infrastructure will call it. Your subclass of ValidationListener
should implement some listener interface. When an interesting event
occurs, call super.validate() and the rest will be taken care of.
problems
- A set of problems which can be added toprotected final boolean validate()
public final boolean verify(javax.swing.JComponent input)
validate()
.verify
in class javax.swing.InputVerifier
input
- The componentpublic static java.lang.String nameForComponent(javax.swing.JComponent jc)
jc.getClientProperty(CLIENT_PROP_NAME)
jc.getName()
jc
- The componentpublic static void setComponentName(javax.swing.JComponent comp, java.lang.String localizedName)