We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and...

14
We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Transcript of We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and...

Page 1: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!

…we think you will too.

Stuart Ervine & Franck Rasolo

Please

plug in

your

laptops

and pair

up.

Page 2: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!

Introduction • In this workshop we'll be building a short

application

• Please figure out how to boot your laptop from either the CD or USB

• If you can't boot from either, please pair up with someone who can

Page 3: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!

What is GWT? • Java toolkit for building rich web applications

• You can write all the code in Java, so no JSPs, templating languages or action classes

• It compiles into Javascript, uses asynchronous requests

• It is more akin to Swing

Page 4: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!

What we're not going to cover here: • No GWTTestCase• No Google API integration• No 3rd party GWT library integration• No optimization

(though feel free to talk to us about this after)• No JSNI• Little, if any, CSS• No clever ruby / python back end integration• No discussion on client architecture• Little, if any, comparison with or discussion

about other (Java) web frameworks

Page 5: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!

The Client• MegaBank are losing lots of cash and can't

be bailed out any further - they can't sell stocks fast enough, you see the dealers didn't get their bonus and can't be bothered answering the phone any more. In fact, they're often seen down the pub...

• They've asked you to develop a front end to a trading platform to allow them to sell stocks online, cutting out the dealer.

Page 6: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!

The Stories• Display account details• Display current holdings• Refresh prices manually• Display the profit as a percentage

of the current price• If profit is negative, show it in red,

otherwise green• Auto ticking refresh (example of a timer)• Add advice (as per existing stories)• Add sell button

Page 7: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!Here's

how it all

hangs

together.

Page 8: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!

Boot up your machines• Boot from the USB drive (BOOT mount)

or CD provided

• Open the APPS mounted drive and run ./start.sh

• IntelliJ should open and you can run the sample application by clicking the Run button (green triangle)

Page 9: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!

What's been done so far• Display account details• Display current holdings• Refresh prices manually• Display the profit as a percentage of the

current price• If profit is negative, show it in red, otherwise

green• Auto ticking refresh (example of a timer)• Add advice (as per existing stories)• Add sell button

Page 10: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!

What's left to do• Refresh prices manually

• Display the profit as a percentage of the current price

• If profit is negative, show it in red, otherwise green

• Auto ticking refresh (example of a timer)

• Add advice (as per existing stories)

• Add sell button

Page 11: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!

Common widgetsButtonButton button = new Button();button.addClickListener(new ClickListener() {    public void onClick(Widget sender) {        // do something    }});

FlowPanel (outputs an HTML DIV tag)FlowPanel panel = new FlowPanel();panel.add(new Label("hello"));panel.add(new Label("goodbye"));

Page 12: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!

TimersHow to use a timer:

Timer timer = new Timer() {    public void run() {        // do something    } };

timer.scheduleRepeating(1000);

Page 13: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!

Any outstanding questions?

Round up

What did

you think?

Does anyone want to show & tell?

Page 14: We like GWT! …we think you will too. Stuart Ervine & Franck Rasolo Please plug in your laptops and pair up.

Welike

GWT!

• The code and slides are available at : http://code.google.com/p/welikegwt-presentation

• Read more about GWT at : http://code.google.com/webtoolkit

• Please contact us at the following :[email protected]

Thank you!