|
||||||||||
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
org.netbeans.validation.api.ui.AbstractValidationListener<CompType,T>
public abstract class AbstractValidationListener<CompType extends javax.swing.JComponent,T>
Convenience ValidationListener which implements Validator directly. Suitable for use when you have a single component that needs custom validation.
Field Summary |
---|
Fields inherited from class org.netbeans.validation.api.ui.ValidationListener |
---|
CLIENT_PROP_NAME |
Constructor Summary | |
---|---|
AbstractValidationListener(CompType comp)
Create a new AbstractValidationListener for the single component passed here as an argument. |
Method Summary | |
---|---|
protected java.lang.String |
findComponentName(CompType comp)
Get the name of the component which should be passed to validate. |
protected abstract T |
getModelObject(CompType comp)
Get the model object that will be passed to validate |
protected void |
onValidate(CompType component,
boolean validationResult)
Called when validation runs. |
protected boolean |
validate(Problems problems)
Perform the validation. |
abstract boolean |
validate(Problems problems,
java.lang.String compName,
T model)
Validate the passed model. |
Methods inherited from class org.netbeans.validation.api.ui.ValidationListener |
---|
nameForComponent, setComponentName, validate, verify |
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 |
Constructor Detail |
---|
public AbstractValidationListener(CompType comp)
comp
- Method Detail |
---|
protected java.lang.String findComponentName(CompType comp)
nameForComponent
which will either return the
client-property based name or the result of getName() on
the component.
comp
- The component
protected abstract T getModelObject(CompType comp)
comp
- The component
protected void onValidate(CompType component, boolean validationResult)
component
- The componentvalidationResult
- The result of validationprotected final boolean validate(Problems problems)
ValidationListener
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.
validate
in class ValidationListener
problems
- A set of problems which can be added to
public abstract boolean validate(Problems problems, java.lang.String compName, T model)
Validator
validate
in interface Validator<T>
problems
- A list of problems.compName
- The name of the component in question (may be null in some cases)model
- The model in question
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |