aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManolo Carrasco <manolo@apache.org>2012-03-15 10:07:17 +0000
committerManolo Carrasco <manolo@apache.org>2012-03-15 10:07:17 +0000
commit1c9c2236c15156e6bb3fce72ecb498786b4df9de (patch)
treee1551d3bba2b615096085bb236555e9b325c29ca
parent8b42588c4d8a1674dba7c226d30add108280590d (diff)
downloadgwtquery-1c9c2236c15156e6bb3fce72ecb498786b4df9de.tar.gz
gwtquery-1c9c2236c15156e6bb3fce72ecb498786b4df9de.zip
Rename class
-rw-r--r--jsquery/src/main/java/gwtquery/jsquery/client/JsMenu.java2
-rw-r--r--jsquery/src/main/java/gwtquery/jsquery/client/JsQuery.java2
-rw-r--r--jsquery/src/main/java/gwtquery/jsquery/client/OverlayGQuery.java10
-rw-r--r--jsquery/src/main/java/gwtquery/jsquery/client/utils/JsQueryUtils.java (renamed from jsquery/src/main/java/gwtquery/jsquery/client/utils/JsQAux.java)15
4 files changed, 16 insertions, 13 deletions
diff --git a/jsquery/src/main/java/gwtquery/jsquery/client/JsMenu.java b/jsquery/src/main/java/gwtquery/jsquery/client/JsMenu.java
index 7051a711..1312cc55 100644
--- a/jsquery/src/main/java/gwtquery/jsquery/client/JsMenu.java
+++ b/jsquery/src/main/java/gwtquery/jsquery/client/JsMenu.java
@@ -3,7 +3,7 @@ package gwtquery.jsquery.client;
public abstract class JsMenu {
public static native void loadPlugin() /*-{
- var l = @gwtquery.jsquery.client.utils.JsQAux::log(Ljava/lang/Object;);
+ var l = @gwtquery.jsquery.client.utils.JsQueryUtils::log(Ljava/lang/Object;);
var window = $wnd;
var document = $doc;
var jQuery = $wnd.$;
diff --git a/jsquery/src/main/java/gwtquery/jsquery/client/JsQuery.java b/jsquery/src/main/java/gwtquery/jsquery/client/JsQuery.java
index 2180b5bb..ad15715a 100644
--- a/jsquery/src/main/java/gwtquery/jsquery/client/JsQuery.java
+++ b/jsquery/src/main/java/gwtquery/jsquery/client/JsQuery.java
@@ -26,7 +26,7 @@ public class JsQuery implements EntryPoint {
}
private native static void testJs() /*-{
- var l = @gwtquery.jsquery.client.utils.JsQAux::log(Ljava/lang/Object;);
+ var l = @gwtquery.jsquery.client.utils.JsQueryUtils::log(Ljava/lang/Object;);
l($.each);
$.each(["a","b"], function(a, b){
l("kk " + " " + a + " " + b);
diff --git a/jsquery/src/main/java/gwtquery/jsquery/client/OverlayGQuery.java b/jsquery/src/main/java/gwtquery/jsquery/client/OverlayGQuery.java
index 8515883c..4708212f 100644
--- a/jsquery/src/main/java/gwtquery/jsquery/client/OverlayGQuery.java
+++ b/jsquery/src/main/java/gwtquery/jsquery/client/OverlayGQuery.java
@@ -1,6 +1,6 @@
package gwtquery.jsquery.client;
-import gwtquery.jsquery.client.utils.JsQAux;
+import gwtquery.jsquery.client.utils.JsQueryUtils;
import org.timepedia.exporter.client.Export;
import org.timepedia.exporter.client.ExportAfterCreateMethod;
@@ -84,7 +84,7 @@ public class OverlayGQuery implements ExportOverlay<GQuery> {
@ExportStaticMethod("$wnd.$")
public static GQuery $(Object o) {
- return JsQAux.dollar(o);
+ return JsQueryUtils.dollar(o);
}
@ExportStaticMethod("$wnd.$")
@@ -94,17 +94,17 @@ public class OverlayGQuery implements ExportOverlay<GQuery> {
@ExportStaticMethod("$wnd.$.extend")
public static JavaScriptObject extend(Object...objs) {
- return JsQAux.extend(objs);
+ return JsQueryUtils.extend(objs);
}
@ExportStaticMethod("$wnd.$.each")
public static JavaScriptObject[] each(JavaScriptObject[] objs, Function f) {
- return JsQAux.each(objs, f);
+ return JsQueryUtils.each(objs, f);
}
@ExportStaticMethod("$wnd.$.inArray")
public static int inArray(Object o, Object arr) {
- return JsQAux.inArray(o, arr);
+ return JsQueryUtils.inArray(o, arr);
}
@ExportInstanceMethod
diff --git a/jsquery/src/main/java/gwtquery/jsquery/client/utils/JsQAux.java b/jsquery/src/main/java/gwtquery/jsquery/client/utils/JsQueryUtils.java
index a4748647..5025f61b 100644
--- a/jsquery/src/main/java/gwtquery/jsquery/client/utils/JsQAux.java
+++ b/jsquery/src/main/java/gwtquery/jsquery/client/utils/JsQueryUtils.java
@@ -12,7 +12,14 @@ import com.google.gwt.query.client.js.JsCache;
import com.google.gwt.query.client.js.JsNodeArray;
import com.google.gwt.query.client.js.JsUtils;
-public abstract class JsQAux {
+/**
+ * These are a set of utility methods needed in jsquery because
+ * either they are not in the GQuery core yet, or they are already
+ * there but we need to modify their behavior.
+ * Most of them should be moved to the GQuery core api.
+ *
+ */
+public abstract class JsQueryUtils {
private native static String dumpObject(JavaScriptObject o) /*-{
var s = "";
@@ -21,17 +28,13 @@ public abstract class JsQAux {
return s;
}-*/;
- private static native void runJsFunction(JavaScriptObject f) /*-{
- f();
- }-*/;
-
public static GQuery dollar(Object o) {
if (o instanceof String) {
return GQuery.$((String) o);
} else if (o instanceof JavaScriptObject) {
JavaScriptObject jso = (JavaScriptObject) o;
if (JsUtils.isFunction(jso)) {
- runJsFunction(jso);
+ new JsUtils.JsFunction(jso).fe();
} else {
GQuery r = GQuery.$(jso);
if (JsUtils.isArray(jso)) {