diff options
author | Manolo Carrasco <manolo@apache.org> | 2011-09-14 12:14:54 +0000 |
---|---|---|
committer | Manolo Carrasco <manolo@apache.org> | 2011-09-14 12:14:54 +0000 |
commit | 715e08e4e7228f27cae55e602923f7fdb9d26463 (patch) | |
tree | ec38a3e81fb28a48e439b036c30b9e063e05f189 /gwtquery-core/src | |
parent | c5f692eb8fe1fa2a785468bc7fd999d70ecb716d (diff) | |
download | gwtquery-715e08e4e7228f27cae55e602923f7fdb9d26463.tar.gz gwtquery-715e08e4e7228f27cae55e602923f7fdb9d26463.zip |
Make data available in Function
Diffstat (limited to 'gwtquery-core/src')
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java index 0792a2e5..1293071b 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java @@ -26,6 +26,7 @@ public abstract class Function { private com.google.gwt.dom.client.Element element = null; private Event event = null; private int index = -1; + private Object[] data = new Object[0]; public <T extends com.google.gwt.dom.client.Element> T getElement() { return element.<T>cast(); @@ -48,6 +49,14 @@ public abstract class Function { index = i; } + public Object[] getData() { + return data; + } + + public void setData(Object...data) { + this.data = data; + } + public int getIndex() { return index; } @@ -131,10 +140,19 @@ public abstract class Function { } /** + * Override this method for bound callbacks + */ + public void f(Object... data) { + setData(data); + f(); + } + + /** * Override this method for bound event handlers if you wish to deal with * per-handler user data. */ public boolean f(Event e, Object data) { + setData(data); setEvent(e); return f(e); } |