| java.lang.Object com.jgoodies.validation.util.AbstractValidationResultModel com.jgoodies.validation.extras.DelayedValidationResultModel
DelayedValidationResultModel | final public class DelayedValidationResultModel extends AbstractValidationResultModel (Code) | | 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.
author: Karsten Lentzsch version: $Revision: 1.7 $ |
DelayedValidationResultModel | public DelayedValidationResultModel(ValidationResultModel subject, int delay)(Code) | | Constructs a DelayedValidationResultModel for the given subject
ValidationResultModel and the specified Timer delay in milliseconds.
Parameters: subject - the underlying (or wrapped) ValidationResultModel Parameters: delay - the milliseconds to wait before a changeshall be committed |
getResult | public ValidationResult getResult()(Code) | | Returns the subject's value or in case of a pending commit,
the pending new value.
the subject's current or future value. |
setResult | public void setResult(ValidationResult newResult)(Code) | | Sets the given new value after this model's delay.
Does nothing if the new value and the latest pending value are the same.
Parameters: newResult - the value to set throws: NullPointerException - if the new result is null |
|
|