Project: Eclipse_Platform_UI
Bug 180746 [DataBinding] TextObservableValue should take a delay-argument
Reported: 2007-04-03 12:08:54 | Status: verified fixed

Sometimes SWT.Modify is needed as update event type but the performance (number of propagated update-events) should be similar to SWT.FocusOut. Therefore I suggest to create an additional constructor with a parameter int delayInMilliseconds which defines a delay between the time the last SWT.Modify-Event occured and fireValueChanging() is called. This will allow the customer to enter multiple characters without starting a validation each time. A further advance is when binding the validation result to a label or similar, the label won't change confusingly while you still enter your text. The current structure of TextObservableValue doesn't provide a way to achieve the described behaviour by subclassing without reimplementation. Maybe this behaviour can even be useful whit SWT.FocusOut ? More information:

Files changed in fix:
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/Observables.java bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/StalenessObservableValue.java bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Observables.java bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/StalenessObservableValue.java bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/swt/SWTObservables.java bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/DelayedObservableValue.java examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet015DelayTextModifyEvents.java