import com.google.gwt.query.client.Function;
import com.google.gwt.query.client.GQuery;
import com.google.gwt.query.client.Promise;
-import com.google.gwt.query.client.plugins.Plugin;
/**
* Implementation of jQuery.Deferred for gwtquery.
*/
-public class Deferred extends GQuery implements Promise.Deferred {
+public class Deferred implements Promise.Deferred {
/**
* Implementation of the Promise interface which is used internally by
}
}
- // Register Deferred as a GQuery plugin
- public static final Class<Deferred> Deferred = GQuery.registerPlugin(
- Deferred.class, new Plugin<Deferred>() {
- public Deferred init(GQuery gq) {
- return new Deferred(gq);
- }
- });
-
/**
* Provides a way to execute callback functions based on one or more objects,
* usually Deferred objects that represent asynchronous events.
private String state = PENDING;
public Deferred() {
- this(null);
- }
-
- protected Deferred(GQuery gq) {
- super(gq);
resolve.add(new Function() {
public void f() {
state = RESOLVED;