Your SlideShare is downloading. ×
0
GWT 2.0

 Sean C. Sullivan
    OSCON
  July 23, 2010
About me
• write AJAX applications in Java
    • compile to JavaScript
    • open source

http://code.google.com/webtoolkit/
GWT 2.0




released on December 8, 2009
GWT SDK
New features in GWT 2.0


• Development Mode
• Speed Tracer
• Developer guided code splitting
New features in GWT 2.0


• Compiler optimizations
• Draft Compile
• Declarative User Interfaces (UiBinder)
New features in GWT 2.0


• Layout panels
• Bundled resources via ClientBundle
• HtmlUnit for testing
Development Mode
Development Mode
Development Mode
Development Mode
Development Mode
Google Plugin for Eclipse
Google Plugin for Eclipse
Google Plugin for Eclipse
Google Plugin for Eclipse
Layout panels in GWT 2.0


• relies on the browser’s layout engine
• works correctly in browser’s standards
  mode
Layout panels in GWT 2.0


• com.google.gwt.user.client.RootLayoutPanel
• com.google.gwt.user.client.LayoutPanel
• com.goo...
Layout panels in GWT 2.0


• com.google.gwt.user.client.ui.SplitLayoutPanel
• com.google.gwt.user.client.ui.StackLayoutPan...
UiBinder


• declarative layout
• XML
• UiBinder constructs HTML at compile time
UiBinder

<!-- HelloWorld.ui.xml -->


<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'>
  <div>
    Hello, <span ui...
UiBinder
    public class HelloWorld extends Widget {
  interface MyUiBinder extends UiBinder<DivElement, HelloWorld> {}
 ...
UiBinder


• com.google.gwt.uibinder.client.UiBinder
• com.google.gwt.uibinder.client.UiField
ClientBundle

• bundle images, CSS, data, and other
  resources
• For more information, see
  http://code.google.com/webto...
ClientBundle
Unit testing with GWT 2.0

 As of 2.0, GWTTestCase no longer uses SWT or
 native code. Instead, it uses HtmlUnit as the
 b...
Unit testing with GWT 2.0


 By default, GWT runs HtmlUnit in the Firefox3
 emulation mode



                 source: goo...
Unit testing with GWT 2.0


 Because HtmlUnit is a GUI-less browser, layout
 cannot be tested on HtmlUnit.



            ...
Unit testing with GWT 2.0

 ... correct tests can sometimes fail on HtmlUnit,
 either because the HtmlUnit support for tha...
Code splitting

• allows you to chunk your GWT code into
  multiple fragments for faster startup
• aka “developer guided c...
Speed Tracer
Speed Tracer
Speed Tracer
Demo #1


• GWT 2.0
• HTML 5
• WebSockets
Demo #2
What’s new in GWT 2.1


• Data presentation widgets
• Model-View-Presenter framework
• Server-side Speed Traces
Questions?
Thank you
GWT 2.0 - OSCON 2010
GWT 2.0 - OSCON 2010
GWT 2.0 - OSCON 2010
GWT 2.0 - OSCON 2010
GWT 2.0 - OSCON 2010
GWT 2.0 - OSCON 2010
GWT 2.0 - OSCON 2010
GWT 2.0 - OSCON 2010
GWT 2.0 - OSCON 2010
GWT 2.0 - OSCON 2010
GWT 2.0 - OSCON 2010
Upcoming SlideShare
Loading in...5
×

GWT 2.0 - OSCON 2010

2,130

Published on

GWT 2.0
OSCON 2010
Portland Oregon
July 23 2010

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,130
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
58
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "GWT 2.0 - OSCON 2010"

  1. 1. GWT 2.0 Sean C. Sullivan OSCON July 23, 2010
  2. 2. About me
  3. 3. • write AJAX applications in Java • compile to JavaScript • open source http://code.google.com/webtoolkit/
  4. 4. GWT 2.0 released on December 8, 2009
  5. 5. GWT SDK
  6. 6. New features in GWT 2.0 • Development Mode • Speed Tracer • Developer guided code splitting
  7. 7. New features in GWT 2.0 • Compiler optimizations • Draft Compile • Declarative User Interfaces (UiBinder)
  8. 8. New features in GWT 2.0 • Layout panels • Bundled resources via ClientBundle • HtmlUnit for testing
  9. 9. Development Mode
  10. 10. Development Mode
  11. 11. Development Mode
  12. 12. Development Mode
  13. 13. Development Mode
  14. 14. Google Plugin for Eclipse
  15. 15. Google Plugin for Eclipse
  16. 16. Google Plugin for Eclipse
  17. 17. Google Plugin for Eclipse
  18. 18. Layout panels in GWT 2.0 • relies on the browser’s layout engine • works correctly in browser’s standards mode
  19. 19. Layout panels in GWT 2.0 • com.google.gwt.user.client.RootLayoutPanel • com.google.gwt.user.client.LayoutPanel • com.google.gwt.user.client.ui.DockLayoutPanel
  20. 20. Layout panels in GWT 2.0 • com.google.gwt.user.client.ui.SplitLayoutPanel • com.google.gwt.user.client.ui.StackLayoutPanel • com.google.gwt.user.client.ui.TabLayoutPanel
  21. 21. UiBinder • declarative layout • XML • UiBinder constructs HTML at compile time
  22. 22. UiBinder <!-- HelloWorld.ui.xml --> <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'>   <div>     Hello, <span ui:field='nameSpan'/>.   </div> </ui:UiBinder>
  23. 23. UiBinder public class HelloWorld extends Widget {   interface MyUiBinder extends UiBinder<DivElement, HelloWorld> {}   private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);   @UiField SpanElement nameSpan;   public HelloWorld() {     // createAndBindUi initializes this.nameSpan     setElement(uiBinder.createAndBindUi(this));   }   public void setName(String name) { nameSpan.setInnerText(name); } }
  24. 24. UiBinder • com.google.gwt.uibinder.client.UiBinder • com.google.gwt.uibinder.client.UiField
  25. 25. ClientBundle • bundle images, CSS, data, and other resources • For more information, see http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html
  26. 26. ClientBundle
  27. 27. Unit testing with GWT 2.0 As of 2.0, GWTTestCase no longer uses SWT or native code. Instead, it uses HtmlUnit as the built-in browser. [...] Debugging GWT Tests in development mode can be done entirely in a Java debugger source: google.com
  28. 28. Unit testing with GWT 2.0 By default, GWT runs HtmlUnit in the Firefox3 emulation mode source: google.com
  29. 29. Unit testing with GWT 2.0 Because HtmlUnit is a GUI-less browser, layout cannot be tested on HtmlUnit. source: google.com
  30. 30. Unit testing with GWT 2.0 ... correct tests can sometimes fail on HtmlUnit, either because the HtmlUnit support for that feature is lacking or because of HtmlUnit’s issues with flakiness when running asynchronous tests source: google.com
  31. 31. Code splitting • allows you to chunk your GWT code into multiple fragments for faster startup • aka “developer guided code splitting” • For more information, see http://code.google.com/webtoolkit/doc/latest/DevGuideCodeSplitting.html
  32. 32. Speed Tracer
  33. 33. Speed Tracer
  34. 34. Speed Tracer
  35. 35. Demo #1 • GWT 2.0 • HTML 5 • WebSockets
  36. 36. Demo #2
  37. 37. What’s new in GWT 2.1 • Data presentation widgets • Model-View-Presenter framework • Server-side Speed Traces
  38. 38. Questions?
  39. 39. Thank you
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×