aboutsummaryrefslogtreecommitdiffstats
path: root/samples/src
diff options
context:
space:
mode:
authorRay Cromwell <cromwellian@gmail.com>2009-05-06 23:33:34 +0000
committerRay Cromwell <cromwellian@gmail.com>2009-05-06 23:33:34 +0000
commite2fcafc45ee4cf09010f7754befd6a5012d5fc54 (patch)
treed51bb8c80608235367e00c126e886f816249f90c /samples/src
parentff6aee1545e86f8fa6e44589c2116d6d8cdb09cf (diff)
downloadgwtquery-e2fcafc45ee4cf09010f7754befd6a5012d5fc54.tar.gz
gwtquery-e2fcafc45ee4cf09010f7754befd6a5012d5fc54.zip
CSS enum work.
Diffstat (limited to 'samples/src')
-rw-r--r--samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java50
-rw-r--r--samples/src/main/java/gwtquery/samples/public/GwtQuerySample.html10
2 files changed, 41 insertions, 19 deletions
diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java
index f86fa89b..74a137b7 100644
--- a/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java
+++ b/samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java
@@ -2,12 +2,16 @@ package gwtquery.samples.client;
import com.google.gwt.core.client.EntryPoint;
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;
+import com.google.gwt.query.client.Effects;
+import com.google.gwt.query.client.GQuery;
+import com.google.gwt.query.client.css.CSS;
+import static com.google.gwt.query.client.GQuery.$;
+import static com.google.gwt.query.client.GQuery.lazy;
+import static com.google.gwt.query.client.css.CSS.*;
+import static com.google.gwt.query.client.css.Length.*;
+import static com.google.gwt.query.client.css.Percentage.*;
+import static com.google.gwt.query.client.css.RGBColor.*;
/**
* Copyright 2007 Timepedia.org Licensed under the Apache License, Version 2.0
@@ -29,20 +33,28 @@ public class GwtQuerySampleModule implements EntryPoint {
// }
public void onModuleLoad() {
- $("div").hover(
- $.lazy().
- css("color", "red").
- done(),
- $.lazy().
- css("color", "blue").
- done());
-
- $(".note").dblclick(
- $.lazy().
- fadeOut().
- done());
- $("div").wrapAll("<table border=2><tr><td></td></tr></table>").fadeOut(10000);
- }
+ GQuery q = $(".note");
+ q.setCss(CSS.BACKGROUND_COLOR, CSS.RED);
+ q.setCss(TEXT_ALIGN, LEFT);
+ q.setCss(VERTICAL_ALIGN, px(10));
+ $("div > div").hover(lazy().
+ css("color", "red").
+ done(), lazy().
+ css("color", "blue").
+ done());
+// $(".note").dblclick(
+// lazy().as(Effects.Effects).
+// fadeOut().
+// done());
+// $("div.outer").dblclick(new Function() {
+// @Override
+// public boolean f(Event e, Object data) {
+// $(e.getCurrentTarget()).as(Effects.Effects).slideUp();
+// return true;
+// }
+// });
+// $("div").wrapAll("<table border=2><tr><td></td></tr></table>");
+ }
}
diff --git a/samples/src/main/java/gwtquery/samples/public/GwtQuerySample.html b/samples/src/main/java/gwtquery/samples/public/GwtQuerySample.html
index a2ab635c..b15701a7 100644
--- a/samples/src/main/java/gwtquery/samples/public/GwtQuerySample.html
+++ b/samples/src/main/java/gwtquery/samples/public/GwtQuerySample.html
@@ -4,7 +4,17 @@
<script language="javascript" src="gwtquery.samples.GwtQuerySample.nocache.js"></script>
</head>
<body>
+<div class="outer">
<div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+ <div>Foo <span class="note">bar</span> baz</div>
+
+</div>
</body>
</html>
\ No newline at end of file