Class DelayedTask

  extended by com.gwtext.client.core.JsObject
      extended by com.gwtext.client.util.DelayedTask

public class DelayedTask
extends JsObject

Provides a convenient method of performing setTimeout where a new timeout cancels the old timeout. An example would be performing validation on a keypress. You can use this class to buffer the keypress events for a certain number of milliseconds, and perform only if they stop for that amount of time.

Field Summary
Fields inherited from class com.gwtext.client.core.JsObject
Constructor Summary
          Creates a new DelayedTask.
Method Summary
 void cancel()
          Cancel the last queued timeout.
 void delay(int delay, Function task)
          Cancels any pending timeout and queues a new one.
Methods inherited from class com.gwtext.client.core.JsObject
getJsObj, getProperties, isCreated, setJsObj
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public DelayedTask()
Creates a new DelayedTask.

Method Detail


public void cancel()
Cancel the last queued timeout.


public void delay(int delay,
                  Function task)
Cancels any pending timeout and queues a new one.

delay - the milliseconds to delay
task - the task