How to start with Google Web Toolkit

1,003 views

Published on

GWT Presentation @ SOCAL CODE CAMP

Published in: Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,003
On SlideShare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
8
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

How to start with Google Web Toolkit

  1. 1. How to start using Google Web Toolkit (GWT) Alline Watkins & June Clarke
  2. 2. http://code.google.com/intl/en/webtoolkit/overview.html By GWT Web Page: Google Web Toolkit (GWT) is a development toolkit for building and optimizing complex browser-based applications. Its goal is to enable productive development of high-performance web applications without the developer having to be an expert in browser quirks, XMLHttpRequest, and JavaScript. GWT is used by many products at Google, including Google Wave and the new version of AdWords. It's open source, completely free, and used by thousands of developers around the world.
  3. 3. Installation: Google Plug-in for Eclipse http://code.google.com/intl/en/eclipse/index.html
  4. 4. Create New GWT Project
  5. 5. Our Application Example - Tic Tac Toe Game
  6. 6. GWT Widgets Showcase http://gwt.google.com/samples/Showcase/Showcase.html Vertical/Horizontal Panel Grid Label HTML Panel Mouse Events Asynchronous Calls RPC's
  7. 7. GWT Browser Plug-in
  8. 8. GWT Browser Plug-in & Debug Mode
  9. 9. The MVP Architecture
  10. 10. Event Handler Anchor anchorTest = new Anchor("Test"); anchorTest.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { // TODO Auto-generated method stub } });
  11. 11. AJAX web application model
  12. 12. Java components of the GWT RPC Mechanism http://code.google.com/webtoolkit/doc/latest/tutorial/RPC.html
  13. 13. Asynchronous Calls GreetingServiceAsync myService = GWT.create(GreetingService.class); myService.myMethod( methodParameters , new AsyncCallback<String>() { @Override public void onSuccess(String result) { // TODO Auto-generated method stub } @Override public void onFailure(Throwable caught) { // TODO Auto-generated method stub } });
  14. 14. Calling Web Services RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url); try { Request request = builder.sendRequest(null, new RequestCallback() { public void onError(Request request, Throwable exception) { //displayError("Couldn't retrieve JSON"); } public void onResponseReceived(Request request, Response response) { if (200 == response.getStatusCode()) { // response.getText(); } else { // response.getStatusText(); } } }); } catch (RequestException e) { //displayError("Couldn't retrieve JSON"); }
  15. 15. The Final Application Example
  16. 16. alline.oliveira@gmail.com joonspoon@joonspoon.com

×