diff options
author | Julien Dramaix <julien.dramaix@gmail.com> | 2011-02-20 17:54:24 +0000 |
---|---|---|
committer | Julien Dramaix <julien.dramaix@gmail.com> | 2011-02-20 17:54:24 +0000 |
commit | a2215bc08f7aba5a6224176c5284827809dee40e (patch) | |
tree | 5d9aa001b709345b1fac850bb208eb3097fd1045 /samples | |
parent | 4a98a73baf6aa3387693e402c34f8a1cabd9d1a0 (diff) | |
download | gwtquery-a2215bc08f7aba5a6224176c5284827809dee40e.tar.gz gwtquery-a2215bc08f7aba5a6224176c5284827809dee40e.zip |
proposal for Widgets plugin
Diffstat (limited to 'samples')
3 files changed, 82 insertions, 18 deletions
diff --git a/samples/src/main/java/gwtquery/samples/GwtQueryWidgets.gwt.xml b/samples/src/main/java/gwtquery/samples/GwtQueryWidgets.gwt.xml index ea6ddd04..014b421b 100644 --- a/samples/src/main/java/gwtquery/samples/GwtQueryWidgets.gwt.xml +++ b/samples/src/main/java/gwtquery/samples/GwtQueryWidgets.gwt.xml @@ -1,5 +1,6 @@ <module> <inherits name='com.google.gwt.query.Query'/> + <inherits name='com.google.gwt.user.theme.chrome.Chrome' /> <entry-point class='gwtquery.samples.client.GwtQueryWidgetModule'/> </module> diff --git a/samples/src/main/java/gwtquery/samples/client/GwtQueryWidgetModule.java b/samples/src/main/java/gwtquery/samples/client/GwtQueryWidgetModule.java index 68950723..65bb2e7c 100644 --- a/samples/src/main/java/gwtquery/samples/client/GwtQueryWidgetModule.java +++ b/samples/src/main/java/gwtquery/samples/client/GwtQueryWidgetModule.java @@ -16,21 +16,18 @@ package gwtquery.samples.client;
import static com.google.gwt.query.client.GQuery.$;
+import static com.google.gwt.query.client.plugins.widgets.Widgets.Widgets;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.query.client.Function;
-import com.google.gwt.query.client.GQuery;
-import com.google.gwt.query.client.plugins.Widgets;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.Event;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.query.client.plugins.widgets.widgetfactory.ButtonWidgetFactory.ButtonOptions;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.PopupPanel;
public class GwtQueryWidgetModule implements EntryPoint {
- public void onModuleLoad() {
+/* public void onModuleLoad() {
$("<button>Enhance</button>").appendTo(".outer").one(Event.ONCLICK, null, new Function() {
public boolean f(Event e) {
$(".btn:nth-child(odd)").each(new Function(){
@@ -52,5 +49,30 @@ public class GwtQueryWidgetModule implements EntryPoint { return true;
}
});
+ }*/
+
+ public void onModuleLoad() {
+
+
+ $(".btn").as(Widgets).buttons(createButtonOptions());
+ $("#tabs").as(Widgets).tabPanel();
+
+ }
+
+ private ButtonOptions createButtonOptions(){
+ ButtonOptions options = new ButtonOptions();
+ options.addClickHandler(new ClickHandler() {
+
+ public void onClick(ClickEvent event) {
+ Label l = new Label("You click on a GWT Button !");
+ PopupPanel panel = new PopupPanel(true, true);
+ panel.setGlassEnabled(true);
+ panel.add(l);
+ panel.center();
+
+ }
+ });
+
+ return options;
}
}
diff --git a/samples/src/main/java/gwtquery/samples/public/GwtQueryWidgets.html b/samples/src/main/java/gwtquery/samples/public/GwtQueryWidgets.html index a414cf94..535eb08e 100644 --- a/samples/src/main/java/gwtquery/samples/public/GwtQueryWidgets.html +++ b/samples/src/main/java/gwtquery/samples/public/GwtQueryWidgets.html @@ -1,20 +1,61 @@ <html>
<head>
- <title>GQuery Demo</title>
- <script language="javascript"
- src="gwtquery.samples.GwtQueryWidgets.nocache.js"></script>
+<title>GQuery Demo</title>
+<script language="javascript"
+ src="gwtquery.samples.GwtQueryWidgets.nocache.js"></script>
</head>
<body>
<div class="outer">
- <div class="btn">Make me a button 1!</div>
- <div class="btn">Make me a button 2!</div>
- <div class="btn">Make me a button 3!</div>
- <div class="btn">Make me a button 4!</div>
- <div class="btn">Make me a button 5!</div>
- <div class="btn">Make me a button 6!</div>
+<div class="btn">Make me a button 1!</div>
+<a class="btn">Make me a button 2!</a> <span class="btn">Make me
+a button 3!</span>
+<button class="btn">Make me a button 4!</button>
+<div class="btn">Make me a button 5!</div>
+<div class="btn">Make me a button 6!</div>
</div>
+<div id="tabs">
+<h3>First tab</h3>
+<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut
+mollis dignissim mattis. In hac habitasse platea dictumst. Cras gravida
+pellentesque purus, ullamcorper euismod enim ornare ac. Suspendisse sed
+tortor diam. Cum sociis natoque penatibus et magnis dis parturient
+montes, nascetur ridiculus mus. Integer a cursus erat. Nam in molestie
+lacus. Nullam adipiscing fermentum magna vel sagittis. Pellentesque et
+nisi orci. Nunc volutpat ornare malesuada. Aliquam erat volutpat. Duis
+hendrerit adipiscing mauris, vitae tincidunt dui sodales eget. Nulla ac
+velit ac nunc dapibus volutpat eget vel eros. Maecenas tincidunt, turpis
+vel placerat imperdiet, metus elit mollis sapien, et egestas felis felis
+vitae metus.</div>
+
+<h3>Second tab</h3>
+<div>Pellentesque habitant morbi tristique senectus et netus et
+malesuada fames ac turpis egestas. Duis feugiat dapibus nunc, sit amet
+sodales dolor bibendum eget. Pellentesque ac libero et nibh ultrices
+vehicula. Morbi convallis auctor ultricies. Class aptent taciti sociosqu
+ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean
+gravida eros at massa fringilla vestibulum. Sed justo dui, euismod et
+venenatis in, vehicula ut nisi. Sed sodales lorem vel est luctus vitae
+ornare erat pulvinar. Maecenas lacus sem, ultrices vitae tincidunt in,
+gravida eget quam. Vestibulum condimentum, augue nec consectetur
+egestas, mi sapien ullamcorper diam, sit amet molestie mauris odio at
+lacus.</div>
+
+<h3>Third tab</h3>
+<div>Vestibulum turpis eros, tempor et hendrerit sit amet,
+hendrerit ut urna. Integer aliquam, neque non sollicitudin pulvinar,
+orci neque faucibus mauris, a molestie massa ligula vitae eros. Proin
+egestas, purus in pharetra aliquam, dolor odio faucibus lorem, ac
+egestas mi orci ac est. Maecenas pellentesque dui id felis tempus
+vestibulum. Vestibulum vitae nisi tortor. Etiam risus arcu, gravida quis
+pellentesque non, sodales at felis. Cras eros diam, pretium ut
+sollicitudin ut, vulputate a ipsum. Curabitur quis leo urna, in bibendum
+nibh. Ut viverra convallis purus vitae eleifend. Cras bibendum nulla a
+felis vestibulum consequat. Aliquam erat volutpat.</div>
+</div>
+</div>
+
+
</body>
</html>
-
\ No newline at end of file |