diff options
author | Ray Cromwell <cromwellian@gmail.com> | 2009-05-05 00:12:58 +0000 |
---|---|---|
committer | Ray Cromwell <cromwellian@gmail.com> | 2009-05-05 00:12:58 +0000 |
commit | 2020aa708fca88b683ff19438de72aa08b268d2d (patch) | |
tree | 69c03b7d2319a1a43cb1920ef892183fa89f9c69 /samples/src | |
parent | 5d89867da687e9b4f01f13bfb2b71a0ad51198e8 (diff) | |
download | gwtquery-2020aa708fca88b683ff19438de72aa08b268d2d.tar.gz gwtquery-2020aa708fca88b683ff19438de72aa08b268d2d.zip |
Added lazy generator
Diffstat (limited to 'samples/src')
4 files changed, 35 insertions, 40 deletions
diff --git a/samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml b/samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml index a655154e..921732a7 100644 --- a/samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml +++ b/samples/src/main/java/gwtquery/samples/GwtQueryBench.gwt.xml @@ -1,5 +1,5 @@ <module> - <inherits name='gwtquery.GwtQuery'/> + <inherits name='com.google.gwt.query.Query'/> <entry-point class='gwtquery.samples.client.GwtQueryBenchModule'/> </module> diff --git a/samples/src/main/java/gwtquery/samples/GwtQueryDemo.gwt.xml b/samples/src/main/java/gwtquery/samples/GwtQueryDemo.gwt.xml index 3569b0b5..d496d5f6 100644 --- a/samples/src/main/java/gwtquery/samples/GwtQueryDemo.gwt.xml +++ b/samples/src/main/java/gwtquery/samples/GwtQueryDemo.gwt.xml @@ -1,5 +1,5 @@ <module> - <inherits name='gwtquery.GwtQuery'/> + <inherits name='com.google.gwt.query.Query'/> <entry-point class='gwtquery.samples.client.GwtQueryDemoModule'/> diff --git a/samples/src/main/java/gwtquery/samples/GwtQuerySample.gwt.xml b/samples/src/main/java/gwtquery/samples/GwtQuerySample.gwt.xml index 7e09e39e..11e8bc71 100644 --- a/samples/src/main/java/gwtquery/samples/GwtQuerySample.gwt.xml +++ b/samples/src/main/java/gwtquery/samples/GwtQuerySample.gwt.xml @@ -1,5 +1,5 @@ <module> - <inherits name='gwtquery.GwtQuery'/> + <inherits name='com.google.gwt.query.Query'/> <entry-point class='gwtquery.samples.client.GwtQuerySampleModule'/> diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java index 98ab6e43..f86fa89b 100644 --- a/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java +++ b/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java @@ -1,23 +1,23 @@ package gwtquery.samples.client;
import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.core.client.JavaScriptObject;
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.user.client.Window;
-import gwtquery.client.*;
+import com.google.gwt.query.client.$;
+import com.google.gwt.query.client.GQuery;
+import com.google.gwt.query.client.Widgets;
+import com.google.gwt.query.client.Function;
+import static com.google.gwt.query.client.Widgets.*;
+import static com.google.gwt.query.client.$.$;
+import com.google.gwt.user.client.Event;
/**
- * Copyright 2007 Timepedia.org
- * 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
+ * Copyright 2007 Timepedia.org 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.
+ * 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.
*
* @author Ray Cromwell <ray@timepedia.log>
*/
@@ -25,29 +25,24 @@ public class GwtQuerySampleModule implements EntryPoint { // public interface Sample extends Selectors {
// @Selector(".note")
// GQuery allNotes();
-// }
- public void onModuleLoad() {
- Window.alert(Builder.newInstance().setFoo("Hello").setBar("World").setBaz("!").toString());
- }
-
- static final class Builder extends JavaScriptObject {
- protected Builder() {}
- public static Builder newInstance() {
- return createObject().cast();
- }
-
- public native Builder setFoo(String x) /*-{
- return x=this.foo=x, this;
- }-*/;
-
- public native Builder setBar(String x) /*-{
- this.bar = x;
- return this;
- }-*/;
+
+ // }
+
+ public void onModuleLoad() {
+ $("div").hover(
+ $.lazy().
+ css("color", "red").
+ done(),
+ $.lazy().
+ css("color", "blue").
+ done());
- public native Builder setBaz(String x) /*-{
- this.baz = x;
- return this;
- }-*/;
+ $(".note").dblclick(
+ $.lazy().
+ fadeOut().
+ done());
+ $("div").wrapAll("<table border=2><tr><td></td></tr></table>").fadeOut(10000);
}
+
+
}
|