|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.InputVerifier
org.netbeans.validation.api.ui.ValidationListener
public abstract class ValidationListener
Abstract base class for listeners which listen on some component, and which are added to a ValidationGroup. Implement whatever listener interface is necessary, add it as a listener to the component(s) it should listen to, and then pass it to ValidationGroup.add().
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.
Field Summary | |
---|---|
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 Summary | |
---|---|
ValidationListener()
|
Method Summary | |
---|---|
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. |
Methods inherited from class javax.swing.InputVerifier |
---|
shouldYieldFocus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLIENT_PROP_NAME
getName()
method is used.
Constructor Detail |
---|
public ValidationListener()
Method Detail |
---|
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 to
protected final boolean validate()
public final boolean verify(javax.swing.JComponent input)
validate()
.
verify
in class javax.swing.InputVerifier
input
- The component
public static java.lang.String nameForComponent(javax.swing.JComponent jc)
jc.getClientProperty(CLIENT_PROP_NAME)
jc.getName()
jc
- The component
public static void setComponentName(javax.swing.JComponent comp, java.lang.String localizedName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |