aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>2012-11-26 13:53:44 +0100
committerManuel Carrasco Moñino <manuel.carrasco.m@gmail.com>2012-11-26 13:53:44 +0100
commit76650136827969ffdade5cfaa03bdf30ba2c6ac9 (patch)
tree3d80d7fe713918dd4c597731e38fa11d8d26fcc6
parent8907470acdf9812b9bf22d87e6c58562d5226d59 (diff)
downloadgwtquery-76650136827969ffdade5cfaa03bdf30ba2c6ac9.tar.gz
gwtquery-76650136827969ffdade5cfaa03bdf30ba2c6ac9.zip
Removing unneeded call to method $ in many places. Removing generic dollar method, not needed since we have the $(Object) signature
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java26
-rw-r--r--gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java8
-rw-r--r--gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTestGwt.java2
3 files changed, 14 insertions, 22 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java
index 098dcc96..f6912470 100644
--- a/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java
+++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java
@@ -263,7 +263,7 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
return $((String)o);
}
if (o instanceof GQuery) {
- return $((GQuery)o);
+ return (GQuery)o;
}
if (o instanceof Function) {
return $((Function)o);
@@ -395,13 +395,6 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
}
/**
- * wraps a GQuery or a plugin object
- */
- public static <T extends GQuery> T $(T gq) {
- return gq;
- }
-
- /**
* Wrap a GQuery around one widget or an array of existing ones.
*/
public static GQuery $(Widget... widgets) {
@@ -671,7 +664,7 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
}
private static GQuery innerHtml(String html, Document doc) {
- return $(cleanHtmlString(html, doc));
+ return cleanHtmlString(html, doc);
}
protected static String[] jsArrayToString(JsArrayString array) {
@@ -1095,12 +1088,11 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
public <T extends GQuery> T as(Class<T> plugin) {
// GQuery is not a plugin for itself
if (plugin == GQUERY) {
- return (T) $(this);
+ return (T)this;
} else if (plugins != null) {
-
Plugin<?> p = plugins.get(plugin);
if (p != null) {
- return (T) p.init(this);
+ return (T)p.init(this);
}
}
throw new RuntimeException("No plugin registered for class " + plugin.getName());
@@ -2095,14 +2087,14 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
* to complete
*/
public GQuery fadeIn(Function... f) {
- return $(as(Effects).fadeIn(f));
+ return as(Effects).fadeIn(f);
}
/**
* Fade in all matched elements by adjusting their opacity.
*/
public GQuery fadeIn(int millisecs, Function... f) {
- return $(as(Effects).fadeIn(millisecs, f));
+ return as(Effects).fadeIn(millisecs, f);
}
/**
@@ -2110,7 +2102,7 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
* milliseconds to complete
*/
public GQuery fadeOut(Function... f) {
- return $(as(Effects).fadeOut(f));
+ return as(Effects).fadeOut(f);
}
/**
@@ -2287,7 +2279,7 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
* of matched elements starts at 0 and goes to length - 1.
*/
public GQuery gt(int pos) {
- return $(slice(pos + 1, -1));
+ return slice(pos + 1, -1);
}
/**
@@ -2757,7 +2749,7 @@ public class GQuery implements Lazy<GQuery, LazyGQuery> {
* element in the set of matched elements starts at 0 and goes to length - 1.
*/
public GQuery lt(int pos) {
- return $(slice(0, pos));
+ return slice(0, pos);
}
/**
diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java
index c90d881a..5ed82a34 100644
--- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java
+++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTestGwt.java
@@ -454,22 +454,22 @@ public class GQueryCoreTestGwt extends GWTTestCase {
assertEquals(1, g1.size());
assertEquals(content, g1.toString());
- $(g1).append(g2);
+ g1.append(g2);
assertEquals(1, g1.size());
assertEquals(1, g2.size());
assertEquals(expected, g2.toString());
- $(g1).prepend(g2);
+ g1.prepend(g2);
assertEquals(1, g1.size());
assertEquals(1, g2.size());
assertEquals(expected, g2.toString());
- $(g1).after(g2);
+ g1.after(g2);
assertEquals(1, g1.size());
assertEquals(1, g2.size());
assertEquals(expected, g2.toString());
- $(g1).before(g2);
+ g1.before(g2);
assertEquals(1, g1.size());
assertEquals(1, g2.size());
assertEquals(expected, g2.toString());
diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTestGwt.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTestGwt.java
index 9f91cbd1..abe708bb 100644
--- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTestGwt.java
+++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryEventsTestGwt.java
@@ -929,7 +929,7 @@ public class GQueryEventsTestGwt extends GWTTestCase {
assertEquals(1, b.size());
assertEquals(1, b.get().getLength());
b.click();
- assertEquals("red", $(b).css("color", false));
+ assertEquals("red", b.css("color", false));
}
public void testResizeEvent() {