aboutsummaryrefslogtreecommitdiffstats
path: root/samples/src/main
diff options
context:
space:
mode:
authorRay Cromwell <cromwellian@gmail.com>2009-04-30 21:43:29 +0000
committerRay Cromwell <cromwellian@gmail.com>2009-04-30 21:43:29 +0000
commit96375a486ad02ebe30af85a7dddc48b7f3e7349d (patch)
tree2fe65f44995720fc8b477b3845fd2c985e6f6d29 /samples/src/main
parent94e9626e350487ade2617ebf0706897d77df1b17 (diff)
downloadgwtquery-96375a486ad02ebe30af85a7dddc48b7f3e7349d.tar.gz
gwtquery-96375a486ad02ebe30af85a7dddc48b7f3e7349d.zip
Refactored to com.google.gwt.query
Fixup javadocs Add tests
Diffstat (limited to 'samples/src/main')
-rw-r--r--samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java5
-rw-r--r--samples/src/main/java/gwtquery/samples/client/GwtQueryDemoModule.java9
-rw-r--r--samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java33
-rw-r--r--samples/src/main/java/gwtquery/samples/client/MySelectors.java3
4 files changed, 38 insertions, 12 deletions
diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java
index 29bddbeb..6ddf6690 100644
--- a/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java
+++ b/samples/src/main/java/gwtquery/samples/client/GwtQueryBenchModule.java
@@ -6,8 +6,9 @@ import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.IncrementalCommand;
-import gwtquery.client.*;
-import static gwtquery.client.GQuery.$;
+import com.google.gwt.query.client.DeferredGQuery;
+import com.google.gwt.query.client.SelectorEngine;
+import static com.google.gwt.query.client.GQuery.$;
public class GwtQueryBenchModule implements EntryPoint {
diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQueryDemoModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQueryDemoModule.java
index 2cc8fa27..3753c25c 100644
--- a/samples/src/main/java/gwtquery/samples/client/GwtQueryDemoModule.java
+++ b/samples/src/main/java/gwtquery/samples/client/GwtQueryDemoModule.java
@@ -7,10 +7,13 @@ import com.google.gwt.dom.client.NodeList;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Node;
import com.google.gwt.user.client.Event;
+import com.google.gwt.query.client.GQuery;
+import com.google.gwt.query.client.Selector;
+import com.google.gwt.query.client.Function;
+import com.google.gwt.query.client.Selectors;
-import static gwtquery.client.GQuery.$;
-import static gwtquery.client.Effects.Effects;
-import gwtquery.client.*;
+import static com.google.gwt.query.client.GQuery.$;
+import static com.google.gwt.query.client.Effects.Effects;
/**
*
diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java
index 23869aa5..98ab6e43 100644
--- a/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java
+++ b/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java
@@ -2,6 +2,7 @@ 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.*;
@@ -21,12 +22,32 @@ import gwtquery.client.*;
* @author Ray Cromwell <ray@timepedia.log>
*/
public class GwtQuerySampleModule implements EntryPoint {
- public interface Sample extends Selectors {
- @Selector(".note")
- GQuery allNotes();
- }
+// public interface Sample extends Selectors {
+// @Selector(".note")
+// GQuery allNotes();
+// }
public void onModuleLoad() {
- Sample s = GWT.create(Sample.class);
- s.allNotes().html("This was a note");
+ 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 native Builder setBaz(String x) /*-{
+ this.baz = x;
+ return this;
+ }-*/;
+ }
}
diff --git a/samples/src/main/java/gwtquery/samples/client/MySelectors.java b/samples/src/main/java/gwtquery/samples/client/MySelectors.java
index 5cb634a4..ff0424d2 100644
--- a/samples/src/main/java/gwtquery/samples/client/MySelectors.java
+++ b/samples/src/main/java/gwtquery/samples/client/MySelectors.java
@@ -2,7 +2,8 @@ package gwtquery.samples.client;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NodeList;
-import gwtquery.client.*;
+import com.google.gwt.query.client.Selector;
+import com.google.gwt.query.client.Selectors;
/**
*/