2. 2
Quick Overview on GWT
• Development toolkit, not a framework
• Code in Java, run as JavaScript
• One codebase, any browser
• Makes Ajax a piece of cake...and faster
3. Today’s Agenda
A lot new in GWT 2.0 and beyond
• UiBinder
• ClientBundle
• LayoutPanel
4. What is UiBinder ?
• Declarative User Interfaces
• Write your HTML in HTML
• Clean separation of the aesthetics of your UI from its
programmatic behavior
• No more Boilerplate code
• Fewer widgets, smaller footprint
• Easier for UI designers who are more comfortable with
XML, HTML and CSS than Java source code
14. public interface Resources extends ClientBundle {
public static final Resources INSTANCE = GWT.create(Resources.class);
@Source(”common.css")
public CommonCss style();
@Source(“logo.gif")
public ImageResource logo ();
@Source("images1.gif")
public ImageResource image1();
...
}
All at once using ClientBundle
22. 22
Resources
Declarative Layout with UiBinder
•
http://code.google.com/webtoolkit/doc/latest/DevGuide
UiBinder.html
• GWT's UI overhaul: UiBinder, ClientBundle, and
Layout Panels - Joel Webber, Ray Ryan
• http://www.youtube.com/watch?
v=g2XclEOJdIc&feature=player_embedded
•
Google Web Toolkit Best Practices Talk at Dev Nexus
By Chris Ramdale of the Google Developer Relations
Team
•
http://www.slideshare.net/cramsdale/gwt-best-
practices-devnexus-2010
helps productivity and maintainability — it's easy to create UI from scratch or copy/paste across templates;
makes it easier to collaborate with UI designers who are more comfortable with XML, HTML and CSS than Java source code;
provides a gradual transition during development from HTML mocks to real, interactive UI;
encourages a clean separation of the aesthetics of your UI (a declarative XML template) from its programmatic behavior (a Java class);
performs thorough compile-time checking of cross-references from Java source to XML and vice-versa;
offers direct support for internationalization that works well with GWT's i18n facility;
and encourages more efficient use of browser resources by making it convenient to use lightweight HTML elements rather than heavier-weight widgets and panels