com.gwtext.client.util
Class DelayedTask

java.lang.Object
  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
jsObj
 
Constructor Summary
DelayedTask()
          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

DelayedTask

public DelayedTask()
Creates a new DelayedTask.

Method Detail

cancel

public void cancel()
Cancel the last queued timeout.


delay

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

Parameters:
delay - the milliseconds to delay
task - the task