public abstract class AbstractValidationListener<CompType extends javax.swing.JComponent,T> extends ValidationListener<CompType>
Constructor and Description |
---|
AbstractValidationListener(java.lang.Class<CompType> type,
CompType comp,
ValidationUI ui,
Validator<T> validator)
Create a new AbstractValidationListener for the single component
passed here as an argument.
|
Modifier and Type | Method and Description |
---|---|
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,
Problem validationResult)
Called when validation runs.
|
protected void |
performValidation(Problems ps)
Called by the simplevalidation infrastructure when it is time to
perform the validation.
|
getTarget
performValidation, runWithValidationSuspended
public AbstractValidationListener(java.lang.Class<CompType> type, CompType comp, ValidationUI ui, Validator<T> validator)
comp
- 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 componentprotected abstract T getModelObject(CompType comp)
comp
- The componentprotected void onValidate(CompType component, Problem validationResult)
component
- The componentvalidationResult
- The result of validationprotected final void performValidation(Problems ps)
ValidationListener
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.
performValidation
in class ValidationListener<CompType extends javax.swing.JComponent>