aboutsummaryrefslogtreecommitdiffstats
path: root/gwtquery-core
diff options
context:
space:
mode:
authorManolo Carrasco <manolo@apache.org>2010-05-12 11:25:52 +0000
committerManolo Carrasco <manolo@apache.org>2010-05-12 11:25:52 +0000
commit5ecd54adf4d054d7e81208485ddae8ccec7206f6 (patch)
treeb200eb66af7ec468642ee57009406f9cff91a38c /gwtquery-core
parentfc2e2ea156649bb809038032bbff52dc705771eb (diff)
downloadgwtquery-5ecd54adf4d054d7e81208485ddae8ccec7206f6.tar.gz
gwtquery-5ecd54adf4d054d7e81208485ddae8ccec7206f6.zip
fixed a typo in SelectorGeneratorNative, Fixes Issue_6
Diffstat (limited to 'gwtquery-core')
-rw-r--r--gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorNative.java9
-rw-r--r--gwtquery-core/src/test/java/com/google/gwt/query/client/GQuerySelectorsTest.java16
2 files changed, 18 insertions, 7 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorNative.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorNative.java
index aabbfd44..4955cbb9 100644
--- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorNative.java
+++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/SelectorGeneratorNative.java
@@ -39,15 +39,12 @@ public class SelectorGeneratorNative extends SelectorGeneratorBase {
TreeLogger treeLogger, boolean hasContext)
throws UnableToCompleteException {
String selector = method.getAnnotation(Selector.class).value();
- System.out.println("generateMethodBody " + method + " " + hasContext);
if (!hasContext) {
- sw.println(
- "return " + wrap(method, "querySelectorAll(\"" + selector + "\"")
- + ");");
+ sw.println("return "
+ + wrap(method, "querySelectorAll(\"" + selector + "\")") + ";");
} else {
sw.println("return "
- + wrap(method, "querySelectorAll(\"" + selector + "\", root)")
- + ");");
+ + wrap(method, "querySelectorAll(\"" + selector + "\", root)") + ";");
}
}
} \ No newline at end of file
diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQuerySelectorsTest.java b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQuerySelectorsTest.java
index dfaaf758..1d1f3c45 100644
--- a/gwtquery-core/src/test/java/com/google/gwt/query/client/GQuerySelectorsTest.java
+++ b/gwtquery-core/src/test/java/com/google/gwt/query/client/GQuerySelectorsTest.java
@@ -62,6 +62,20 @@ public class GQuerySelectorsTest extends GWTTestCase {
@Selector(".branchB")
public GQuery branchB(Node n);
+
+ @Selector("*:checked")
+ public GQuery allChecked();
+
+ @Selector("*:checked")
+ public GQuery allChecked(Node n);
+ }
+
+ public void testSelectorsGeneratorNative() {
+ $(e).html( "<input type='radio' name='n' value='v1'>1</input>"
+ + "<input type='radio' name='n' value='v2' checked='checked'>2</input>");
+
+ TestSelectors selectors = GWT.create(TestSelectors.class);
+ assertEquals(1, selectors.allChecked().size());
}
public void testSelectorsWithContext() {
@@ -75,7 +89,7 @@ public class GQuerySelectorsTest extends GWTTestCase {
Element branchB = selectors.branchB().get(0);
assertNotNull(selectors.branchA().get(0));
assertNotNull(selectors.branchB().get(0));
-
+
assertEquals(2, selectors.target(RootPanel.getBodyElement()).length());
branchA = selectors.branchA(RootPanel.getBodyElement()).get(0);
branchB = selectors.branchB(RootPanel.getBodyElement()).get(0);