public abstract class ValidationListener<TargetType> extends ValidationItem implements java.util.EventListener
Validator
.
Implement whatever UI component listener interface
is necessary, add it as a listener to the UI component(s) it should listen to, and
then pass the listener to ValidationGroup.add()
.
When an event that should
trigger validation occurs, let the listener (the subclass of ValidationListener
) call the
ValidationItem.performValidation()
method to notfify the simplevalidation infrastructure
what's going on. The infrastrure will then usually call the performValidation(org.netbeans.validation.api.Problems)
method, in which the the listener (the subclass of ValidationItem
)
should validate the UI-component using a suitable Validator
.
Note that one validation listener may not belong to more than one ValidationGroup.
Modifier | Constructor and Description |
---|---|
protected |
ValidationListener(java.lang.Class<TargetType> targetType,
ValidationUI ui,
TargetType component) |
Modifier and Type | Method and Description |
---|---|
protected TargetType |
getTarget() |
protected abstract void |
performValidation(Problems problems)
Called by the simplevalidation infrastructure when it is time to
perform the validation.
|
performValidation, runWithValidationSuspended
protected ValidationListener(java.lang.Class<TargetType> targetType, ValidationUI ui, TargetType component)
protected abstract void performValidation(Problems problems)
If the component to be validated is disabled (it is greyed out and can't be interacted with) it is usually considered to have no problems.
protected final TargetType getTarget()