aboutsummaryrefslogtreecommitdiffstats
path: root/gwtquery-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'gwtquery-core/src')
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/Function.java18
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);
}