<<

Web Toolkit Introduction to GWT Development

Ilkka Rinne & Sampo Savolainen / Spatineo Oy

GeoMashup CodeCamp 2011 University of Helsinki Department of Computer Science

24. lokakuuta 11

24. lokakuuta 11 Google Web Toolkit

Code your browser apps in

24. lokakuuta 11 Google Web Toolkit

Code your browser apps in Java

Test your app locally in your browser

24. lokakuuta 11 Google Web Toolkit

Code your browser apps in Java

Test your app locally in your browser

Debug your code using regular IDE

24. lokakuuta 11 Google Web Toolkit

Code your browser apps in Java

Test your app locally in your browser

Debug your code using regular IDE debuggers

24. lokakuuta 11 Google Web Toolkit

Code your browser apps in Java

Test your app locally in your browser

Debug your code using regular IDE debuggers

GWT compiles your app into optimized JavaScript

24. lokakuuta 11 Google Web Toolkit

Code your browser apps in Java

Test your app locally in your browser

Debug your code using regular IDE debuggers

GWT compiles your app into optimized JavaScript

24. lokakuuta 11 Google Web Toolkit

Code your browser apps in Java

Test your app locally in your browser

Debug your code using regular IDE debuggers

GWT compiles your app into optimized JavaScript

Deploy anywhere (it’s just JS + CSS + HTML)

24. lokakuuta 11 Don’t Worry About

24. lokakuuta 11 Don’t Worry About Coding in JavaScript (embed JavaScript code with JSNI if you really have to)

24. lokakuuta 11 Don’t Worry About Coding in JavaScript (embed JavaScript code with JSNI if you really have to)

Developing in browser (use the Java IDE you like)

24. lokakuuta 11 Don’t Worry About Coding in JavaScript (embed JavaScript code with JSNI if you really have to)

Developing in browser (use the Java IDE you like)

Implementation details of client-server communication over HTTP

24. lokakuuta 11 Don’t Worry About Coding in JavaScript (embed JavaScript code with JSNI if you really have to)

Developing in browser (use the Java IDE you like)

Implementation details of client-server communication over HTTP

Writing cross-browser compatible JavaScript + DOM

24. lokakuuta 11 Development Mode

Since GWT 2.0: dev mode code is run in the browser as Java (GWT Dev Plugin)

IDE Java debugging, code as you save & refresh. Speeds things up! Dev mode also runs a local server to simulate your server side GWT code (RPC Servlets)

24. lokakuuta 11 UI Components Basic components for building “Java-like” GUIs for browser applications:

Page & panel layouts Buttons, trees, , input fields, etc.

24. lokakuuta 11 UI Components Basic components for building “Java-like” GUIs for browser applications:

Page & panel layouts Buttons, trees, tables, input fields, etc.

24. lokakuuta 11 UI Components Basic components for building “Java-like” GUIs for browser applications:

Page & panel layouts Buttons, trees, tables, input fields, etc.

24. lokakuuta 11 UI Components Basic components for building “Java-like” GUIs for browser applications:

Page & panel layouts Buttons, trees, tables, input fields, etc.

24. lokakuuta 11 UI Components Basic components for building “Java-like” GUIs for browser applications:

Page & panel layouts Buttons, trees, tables, input fields, etc.

24. lokakuuta 11 UI Components Basic components for building “Java-like” GUIs for browser applications:

Page & panel layouts Buttons, trees, tables, input fields, etc.

Extended by third party developers to provide more elaborate components

Demo: http://gwt.google.com/samples/Showcase/Showcase.html

24. lokakuuta 11 Google API Integration Google API integration using separate libraries

Gears API Library 1.3 Gadgets API Library 1.2 Google Search API Library 1.1 Currently API Library 1.1 Note: use 1.1.1-RC1 for now! released: Google Chart Tools (aka Visualization) Library 1.1 Google Language API Library 1.1 Google Ajax Loader API Library 1.1 Google+ API Library 0.2-alpha API Library 0.2-alpha API Library 0.2-alpha etc.

http://code.google.com/p/gwt-google-apis/

24. lokakuuta 11 JRE Emulation Library

Final GWT apps run in JavaScript (without JRE)

GWT Provides JRE emulation for JRE 1.5 basic functionality, but not all of it.

Be especially careful with time/date handling, regular expressions, number formatting, timers

http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsCompatibility.

24. lokakuuta 11 Java-to-JavaScript Compiler When you’re ready to deploy your code, ask GWT to compile GWT generates JS, HTML, CSS, packages them into a WAR file with image resources etc.

Ready to be deployed on a Java Servlet Container or Note: Extract .nocache.js and .cache.html + resources from the WAR file to run without a Servlet Container

24. lokakuuta 11 Let’s see some code!

GWT Development in

Codecamp demo application

Deployment to Google App Engine

24. lokakuuta 11