GWT 2.0 Sean C. Sullivan OSCON July 23, 2010 About me write AJAX - - PowerPoint PPT Presentation

gwt 2 0
SMART_READER_LITE
LIVE PREVIEW

GWT 2.0 Sean C. Sullivan OSCON July 23, 2010 About me write AJAX - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

GWT 2.0

Sean C. Sullivan OSCON July 23, 2010

slide-2
SLIDE 2

About me

slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6
  • write AJAX applications in Java
  • compile to JavaScript
  • open source

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

slide-7
SLIDE 7

released on December 8, 2009

GWT 2.0

slide-8
SLIDE 8

GWT SDK

slide-9
SLIDE 9
slide-10
SLIDE 10

New features in GWT 2.0

  • Development Mode
  • Speed Tracer
  • Developer guided code splitting
slide-11
SLIDE 11

New features in GWT 2.0

  • Compiler optimizations
  • Draft Compile
  • Declarative User Interfaces (UiBinder)
slide-12
SLIDE 12

New features in GWT 2.0

  • Layout panels
  • Bundled resources via ClientBundle
  • HtmlUnit for testing
slide-13
SLIDE 13

Development Mode

slide-14
SLIDE 14

Development Mode

slide-15
SLIDE 15

Development Mode

slide-16
SLIDE 16

Development Mode

slide-17
SLIDE 17

Development Mode

slide-18
SLIDE 18

Google Plugin for Eclipse

slide-19
SLIDE 19

Google Plugin for Eclipse

slide-20
SLIDE 20

Google Plugin for Eclipse

slide-21
SLIDE 21

Google Plugin for Eclipse

slide-22
SLIDE 22

Layout panels in GWT 2.0

  • relies on the browser’s layout engine
  • works correctly in browser’s standards

mode

slide-23
SLIDE 23

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
slide-24
SLIDE 24

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
slide-25
SLIDE 25

UiBinder

  • declarative layout
  • XML
  • UiBinder constructs HTML at compile time
slide-26
SLIDE 26

UiBinder

<!-- HelloWorld.ui.xml --> <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'> <div> Hello, <span ui:field='nameSpan'/>. </div> </ui:UiBinder>

slide-27
SLIDE 27

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); } }

slide-28
SLIDE 28

UiBinder

  • com.google.gwt.uibinder.client.UiBinder
  • com.google.gwt.uibinder.client.UiField
slide-29
SLIDE 29

ClientBundle

  • bundle images, CSS, data, and other

resources

  • For more information, see

http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html

slide-30
SLIDE 30

ClientBundle

slide-31
SLIDE 31

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

slide-32
SLIDE 32

By default, GWT runs HtmlUnit in the Firefox3 emulation mode

source: google.com

Unit testing with GWT 2.0

slide-33
SLIDE 33

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

source: google.com

Unit testing with GWT 2.0

slide-34
SLIDE 34

... 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

Unit testing with GWT 2.0

slide-35
SLIDE 35

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

slide-36
SLIDE 36

Speed Tracer

slide-37
SLIDE 37

Speed Tracer

slide-38
SLIDE 38

Speed Tracer

slide-39
SLIDE 39

Demo #1

  • GWT 2.0
  • HTML 5
  • WebSockets
slide-40
SLIDE 40
slide-41
SLIDE 41
slide-42
SLIDE 42
slide-43
SLIDE 43

Demo #2

slide-44
SLIDE 44
slide-45
SLIDE 45
slide-46
SLIDE 46

What’s new in GWT 2.1

  • Data presentation widgets
  • Model-View-Presenter framework
  • Server-side Speed Traces
slide-47
SLIDE 47

Questions?

slide-48
SLIDE 48

Thank you

slide-49
SLIDE 49
slide-50
SLIDE 50