|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.common.bean.AbstractBean
com.jgoodies.validation.util.AbstractValidationResultModel
com.jgoodies.validation.extras.DelayedValidationResultModel
public final class DelayedValidationResultModel
A ValidationResultModel that defers changes for a specified delay. Useful to coalesce frequent validation result changes. For example if a validation requires some heavy computation, you may desire to perform the validation only for a "stable" input state after a series of quick input changes.
Wraps a given subject ValidationResultModel and returns the subject ValidationResult or the ValidationResult to be set as this model's result. Observes subject validation result property changes and forwards them to listeners of this model. If a ValidationResult is set to this model, a Swing Timer is used to delay the ValidationResult commit to the subject. A previously started timer - if any - will be stopped before.
Field Summary |
---|
Fields inherited from class com.jgoodies.common.bean.AbstractBean |
---|
changeSupport |
Fields inherited from interface com.jgoodies.validation.ValidationResultModel |
---|
PROPERTY_ERRORS, PROPERTY_MESSAGES, PROPERTY_RESULT, PROPERTY_SEVERITY, PROPERTYNAME_ERRORS, PROPERTYNAME_MESSAGES, PROPERTYNAME_RESULT, PROPERTYNAME_SEVERITY |
Constructor Summary | |
---|---|
DelayedValidationResultModel(ValidationResultModel subject,
int delay)
Constructs a DelayedValidationResultModel for the given subject ValidationResultModel and the specified Timer delay in milliseconds. |
Method Summary | |
---|---|
ValidationResult |
getResult()
Returns the subject's value or in case of a pending commit, the pending new value. |
void |
setResult(ValidationResult newResult)
Sets the given new value after this model's delay. |
Methods inherited from class com.jgoodies.validation.util.AbstractValidationResultModel |
---|
firePropertyChanges, getSeverity, hasErrors, hasMessages |
Methods inherited from class com.jgoodies.common.bean.AbstractBean |
---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPropertyChangeSupport, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jgoodies.common.bean.ObservableBean2 |
---|
addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener |
Methods inherited from interface com.jgoodies.common.bean.ObservableBean |
---|
addPropertyChangeListener, removePropertyChangeListener |
Constructor Detail |
---|
public DelayedValidationResultModel(ValidationResultModel subject, int delay)
subject
- the underlying (or wrapped) ValidationResultModeldelay
- the milliseconds to wait before a change
shall be committedMethod Detail |
---|
public ValidationResult getResult()
ValidationResultModel.setResult(ValidationResult)
public void setResult(ValidationResult newResult)
newResult
- the value to set
NullPointerException
- if the new result is null
ValidationResultModel.getResult()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |