]> source.dussan.org Git - gwtquery.git/commitdiff
adding Lazy interface for Widgets plugin. Fixing a test
authorManolo Carrasco <manolo@apache.org>
Sun, 16 Jan 2011 10:16:01 +0000 (10:16 +0000)
committerManolo Carrasco <manolo@apache.org>
Sun, 16 Jan 2011 10:16:01 +0000 (10:16 +0000)
extractLazyInterfaces.sh
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyWidgets.java [new file with mode: 0644]
gwtquery-core/src/test/java/com/google/gwt/query/client/GQueryCoreTest.java

index 25d480c433d9cb4c62587db651b4d9d8fdd2b810..89f13b80946baa5e243d1bc2ade82d727cfa136e 100644 (file)
@@ -2,4 +2,5 @@
 
 perl extractInterface.pl --lazy --input=./gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Events.java
 perl extractInterface.pl --lazy --input=./gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java
+perl extractInterface.pl --lazy --input=./gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Widgets.java
 perl extractInterface.pl --lazy --input=./gwtquery-core/src/main/java/com/google/gwt/query/client/GQuery.java
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyWidgets.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/LazyWidgets.java
new file mode 100644 (file)
index 0000000..27ec1ee
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2009 Google Inc.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.query.client.plugins;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.NodeList;
+import com.google.gwt.query.client.GQuery;
+import com.google.gwt.query.client.JSArray;
+import com.google.gwt.query.client.Plugin;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.query.client.LazyBase;
+
+public interface LazyWidgets<T> extends LazyBase<T>{
+
+  Widget widget();
+
+}
index e287f29481d6e1cd3b1d2f2fb9cdb2fa1754ed4f..061f827721970b5cf26f94a428a35e85b44e5814 100644 (file)
@@ -303,18 +303,18 @@ public class GQueryCoreTest extends GWTTestCase {
   public void testIssue23() {
     $(e).html("<table><tr><td><input type='radio' name='n' value='v1'>1</input><input type='radio' name='n' value='v2' checked='checked'>2</input></td><td><button>Click</button></tr><td></table>");
     $("button").click(new Function() {
-      public boolean f(Event e) {
-        $("table > tbody > tr > td > input:checked").each(new Function() {
+      public boolean f(Event ev) {
+       done = 0;
+        $("table > tbody > tr > td > input:checked", e).each(new Function() {
           public void f(Element e) {
             done++;
           }
         });
+        assertEquals(1, done);
         return true;
       }
     });
-    done = 0;
     $("button").click();
-    assertEquals(1,done);
   }
 
   public void testModifyMethods() {