public final class DelayedValidationResultModel extends AbstractValidationResultModel
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.
PROPERTY_ERRORS, PROPERTY_MESSAGES, PROPERTY_RESULT, PROPERTY_SEVERITY, PROPERTYNAME_ERRORS, PROPERTYNAME_MESSAGES, PROPERTYNAME_RESULT, PROPERTYNAME_SEVERITY
Constructor and Description |
---|
DelayedValidationResultModel(ValidationResultModel subject,
int delay)
Constructs a DelayedValidationResultModel for the given subject
ValidationResultModel and the specified Timer delay in milliseconds.
|
Modifier and Type | Method and Description |
---|---|
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.
|
firePropertyChanges, getSeverity, hasErrors, hasMessages
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public DelayedValidationResultModel(ValidationResultModel subject, int delay)
subject
- the underlying (or wrapped) ValidationResultModeldelay
- the milliseconds to wait before a change
shall be committedpublic ValidationResult getResult()
ValidationResultModel.setResult(ValidationResult)
public void setResult(ValidationResult newResult)
newResult
- the value to setNullPointerException
- if the new result is null
ValidationResultModel.getResult()
Copyright © 2003-2011 JGoodies Karsten Lentzsch. All Rights Reserved.