GWT In-depth Explained by Rohit Ghatol

Slides:



Advertisements
Similar presentations
Samsung Smart TV is a web-based application running on an application engine installed on digital TVs connected to the Internet.
Advertisements

Google Web Toolkit (GWT) Steve Wargolet. Introduction Desktop client-server applications and their drawbacks. Static-only Web pages Introduction of Web.
GWT - RPC. RPC plumbing diagram package com.mycompany.client; import com.google.gwt.user.client.rpc.RemoteService; public interface MyAddService extends.
Fawaz Ghali AJAX: Web Programming's Toy.
Web Toolkit Julie George & Ronald Lopez 1. Requirements  Java SDK version 1.5 or later  Apache Ant is also necessary to run command line arguments 
1 An Overview of the Google Web Toolkit (GWT) November 15, 2006.
1 GWT Google Web Toolkit Build AJAX apps in the Java language
Introducing Mapbuilder Michael Adair Natural Resources Canada.
© 2007 IBM Corporation IBM Emerging Technologies Enabling an Accessible Web 2.0 Becky Gibson Web Accessibility Architect.
Google Web Toolkit - Gufran Mohammed. Google Web Toolkit (GWT) is an open source Java software development framework that makes writing AJAX applications.
Internet Technologies 1 Master of Information System Management Java Server Faces Model/View/Controller Design Pattern for Web Development Slides.
Principles of Object-Oriented Software Development The language Java.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
Microsoft ASP.NET AJAX - AJAX as it has to be Presented by : Rana Vijayasimha Nalla CSCE Grad Student.
Object-Oriented Analysis and Design
GWT-EXT 로 Web application 개발하기
UNIT-V The MVC architecture and Struts Framework.
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Accessibility for Rich Internet Applications: Colin Clark, Fluid Project Technical Lead, Adaptive Technology Resource Centre Techniques & Toolkits.
P&O3: Tools & methodologies Stefaan Ternier. Overview TCP/IP Servlets Google Web Toolkit Google Maps JPDA.
Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension.
JavaScript & jQuery the missing manual Chapter 11
CS378 - Mobile Computing Web - WebView and Web Services.
INNOV-10: Getting Started with Ajax Ken Wilner VP of Technology.
© 2005 by IBM; made available under the EPL v1.0 | March 1, 2005 Tim deBoer Gorkem Ercan Extend WTP Server Tools for your.
Observer Design Pattern Source: Design Patterns – Elements of Reusable Object- Oriented Software; Gamma, et. al.
Echo2 Java AJAX Web Framework Petar Milev. Contents 1.Introduction to Echo2 2.Echo2 Target – Business Web 3.Why Choosing Echo2? 4.Live Demo 5.How It Works?
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
DUE Hello World on the Android Platform.
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat
FLTK Tutorial.
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Google Web Toolkit An Overview By Shauvik Roy Choudhary.
Contrasting styles of Web UI Development: GWT vs Native JavaScript Roland Schweitzer Weathertop Consulting, LLC Jeremy Malczyk JISAO.
Google Web Toolkit Paul Heiniz, Wolfgang Kluth, Jan Marten, Malte Behrendt Web Technologies – Prof. Dr. Ulrik Schroeder – WS 2010/111 The slides are licensed.
JavaScript Framework for Rich Apps in Every Browser Maura Wilder Joan Wortman
© 2006 IBM Corporation JDojo & ScriptEngine Agile Planning’s Scripting Tools.
What’s new in Kentico CMS 5.0 Michal Neuwirth Product Manager Kentico Software.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
Grid Operations Center Infrastructure Team Soichi Hayashi, Arvind Gopu.
An Introduction to Programming and Object Oriented Design using Java 3 rd Edition. Dec 2007 Jaime Niño Frederick Hosch Chapter 18 Integrating user interface.
ESafe Open Modules Overview Open modules implementing the eSafe document exchange protocol.
New Selectors Extension Module Webinar March 11th, 2010.
JavaServer Faces (JSF) and Ajax Integration. Agenda 대강의 ( 정말로..) 개요 예제 아키텍트라면..
Google Web Toolkit. What is GWT? GWT is a development toolkit for building and optimizing complex Ajax applications Goal is to enable productive development.
INFSOM-RI The ETICS Web Portal WP5 activity Tomasz Kokoszka CERN/WP5.
(1) Introduction to Java GUIs Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu.
Jan Hatje, DESY CSS GSI Feb. 2009: Technology and Interfaces XFEL The European X-Ray Laser Project X-Ray Free-Electron Laser 1 CSS – Control.
Ajax and the GWT. Ajax  Asynchronous JavaScript And XML  Technology behind interactive web sites  Provide smoother experience than conventional web.
Kuali Days :: Chicago May 13-14, 2008 Kuali Student User Interface Overview.
05 | Integrating JavaScript and MVC 4 Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
Flux & React Web Application Development Mark Repka, Rich McNeary, Steve Mueller.
Ext JS - Direct Bridging The Gap A DMSBT Presentation By Timothy Chandler.
Guide To Develop Mobile Apps With Titanium. Agenda Overview Installation of Platform SDKs Pros of Appcelerator Titanium Cons of Appcelerator Titanium.
Google Web Toolkit (GWT) St. Louis Java SIG April 12, 2007 Brad Busch Andrew Prunicki.
Yochay Kiriaty Senior Technical Evangelist Microsoft® Corporation
Business Directory REST API
Google Web Toolkit Tutorial
GWT - RPC.
Development-Introduction
Google Web Toolkit - Gufran Mohammed
An Overview of the Google Web Toolkit (GWT)
Introduction to Silverlight
Modern web applications
Building Graphical User Interface with Swing a short introduction
JavaServer Faces: The Fundamentals
Modern web applications
Dongwhan Kim Annie Zhao Steven Lawrance
Kuali Student User Interface Overview
Presentation transcript:

GWT In-depth Explained by Rohit Ghatol

Topics Covered Short Introduction to GWT Architectural Overview Simple Code Example MVC Code Example Server Communication using GWT – RPC Open source Libraries

Introduction to GWT Read more on GWT Overview PageGWT Overview Page

Key Features Read more on GWT Overview PageGWT Overview Page Reusable UI components Really Simple RPC Cross browser compatible Javascript Native Interface (JSNI) Features

Key Features Read more on GWT Overview PageGWT Overview Page Real DebuggingInternationalization JUnit Integration Completely Open source Features

GWT Documentation Links Developer's Guide – Fundamentals Fundamentals – User Interfaces User Interfaces – Remote Procedure Calls Remote Procedure Calls – Unit Testing Unit Testing – Internationalization Internationalization – JavaScript Native Interface (JSNI) JavaScript Native Interface (JSNI) – JRE Emulation JRE Emulation – GWT Class API GWT Class API

Install GWT

E:\Work\GWT-Demo>set PATH=e:\worksoft\gwt-windows ;%PATH% E:\Work\GWT-Demo>projectCreator -eclipse SimpleDemo Created directory E:\Work\GWT-Demo\src Created directory E:\Work\GWT-Demo\test Created file E:\Work\GWT-Demo\.project Created file E:\Work\GWT-Demo\.classpath E:\Work\GWT-Demo>applicationCreator -eclipse SimpleDemo com.gwt.demo.client.SimpleDemo Created directory E:\Work\GWT-Demo\src\com\gwt\demo Created directory E:\Work\GWT-Demo\src\com\gwt\demo\client Created directory E:\Work\GWT-Demo\src\com\gwt\demo\public Created file E:\Work\GWT-Demo\src\com\gwt\demo\SimpleDemo.gwt.xml Created file E:\Work\GWT-Demo\src\com\gwt\demo\public\SimpleDemo.html Created file E:\Work\GWT-Demo\src\com\gwt\demo\client\SimpleDemo.java Created file E:\Work\GWT-Demo\SimpleDemo.launch Created file E:\Work\GWT-Demo\SimpleDemo-shell.cmd Created file E:\Work\GWT-Demo\SimpleDemo-compile.cmd E:\Work\GWT-Demo>set PATH=e:\worksoft\gwt-windows ;%PATH% E:\Work\GWT-Demo>projectCreator -eclipse SimpleDemo Created directory E:\Work\GWT-Demo\src Created directory E:\Work\GWT-Demo\test Created file E:\Work\GWT-Demo\.project Created file E:\Work\GWT-Demo\.classpath E:\Work\GWT-Demo>applicationCreator -eclipse SimpleDemo com.gwt.demo.client.SimpleDemo Created directory E:\Work\GWT-Demo\src\com\gwt\demo Created directory E:\Work\GWT-Demo\src\com\gwt\demo\client Created directory E:\Work\GWT-Demo\src\com\gwt\demo\public Created file E:\Work\GWT-Demo\src\com\gwt\demo\SimpleDemo.gwt.xml Created file E:\Work\GWT-Demo\src\com\gwt\demo\public\SimpleDemo.html Created file E:\Work\GWT-Demo\src\com\gwt\demo\client\SimpleDemo.java Created file E:\Work\GWT-Demo\SimpleDemo.launch Created file E:\Work\GWT-Demo\SimpleDemo-shell.cmd Created file E:\Work\GWT-Demo\SimpleDemo-compile.cmd

Demo GWT Project Site - Download demo project from herehere

GWT Project Anatomy GWT-Demo +src +com/gwt/demo SimpleDemo.gwt.xml - client SimpleDemo.java - public SimpleDemo.html

GWT Project Anatomy SimpleDemo.gwt.xml 1.Module XML Definition File 2.Includes Project Dependencies 3.Includes Entry Point 4.Includes RPC Servlet Entry SimpleDemo.java 1.This is the Entry Point 2.Entry Point is like Main Method 3.Widgets are added to RootPanel SimpleDemo.html 1.This is the final deliverable HTML/JSP/ASP/PHP 2.Includes JS file for SimpleDemo 3.Includes PlaceHolder Elements

Shuffle Box Example

RootPanel

Shuffle Box Example HorizontalPanel

Shuffle Box Example VerticalPanel

Shuffle Box Example

new ClickListener(){ public void onClick(Widget sender) { int leftIndex=leftListBox.getSelectedIndex(); if(leftIndex==-1){ Window.alert("Select an Item from Left List Box"); } else{ String item=leftListBox.getItemText(leftIndex); leftListBox.removeItem(leftIndex); rightListBox.addItem(item); }

Observable # List observers + addObserver(Observer observer) + removeObserver(Observer observer) + notifyObservers() Observer > + update(Observable model) Notify Register/Unregister View Source for Observable.javaObservable.java View Source for Observer.javaObserver.java

MVC Demo

# temperature + setTemp(int temp) +int getTemp() TempModel # observers + addObserver() +removeObserver() + notifyObserver() Observerable FahrViewCelsViewThermoView update(Observable mode) Observer

MVC Demo # temperature + setTemp(int temp) +int getTemp() TempModel # observers + addObserver() +removeObserver() + notifyObserver() Observerable FahrViewCelsViewThermoView update(Observable mode) Observer Renders

MVC Demo # temperature + setTemp(int temp) +int getTemp() TempModel # observers + addObserver() +removeObserver() + notifyObserver() Observerable FahrViewCelsViewThermoView update(Observable mode) Observer Register

MVC Demo # temperature + setTemp(int temp) +int getTemp() TempModel # observers + addObserver() +removeObserver() + notifyObserver() Observerable FahrView CelsView ThermoView update(Observable mode) Observer User clicked increment button Changes

MVC Demo # temperature + setTemp(int temp) +int getTemp() TempModel # observers + addObserver() +removeObserver() + notifyObserver() Observerable FahrViewCelsViewThermoView update(Observable mode) Observer Notifies All the Views Update themselves using update() method

MVC Demo source files FahrView.java CelsView.java ThermoView.java TempModel.java

RPC Demo

RPC Classes Explained LocationService > List getStates(String country) LocationServiceImpl List getStates(String country) RemoteService > List getStates(String country) RemoteServiceServlet LocationServiceAsync > Void getStates(String country, AsyncCallback callback) LocationServiceUtil public static LocationServiceAsync getInstance() GWT Magic Glue GWT Classes

RPC Classes Explained AsyncCallback > void onSuccess(Object result); void onFailure(Throwable caught);

LocationServiceUtil Code Use GWT Glue to link LocationService and LocationServiceAsync classes LocationServiceAsync serviceAsync = (LocationServiceAsync) GWT.create(LocationService.class); Set the Service’s Entry point (aka url) ((ServiceDefTarget) serviceAsync).setServiceEntryPoint(GWT.getModuleBaseURL()+ "/LocationService");

LocationServiceUtil Code public class LocationServiceUtil { public static LocationServiceAsync createService() { LocationServiceAsync serviceAsync = (LocationServiceAsync) GWT.create(LocationService.class); ((ServiceDefTarget) serviceAsync).setServiceEntryPoint(GWT.getModuleBaseURL()+ "/LocationService"); return serviceAsync; }

RPC Client Code LocationServiceAsync serviceAsync = LocationServiceUtil.createService(); serviceAsync.getStates(country, new AsyncCallback() { public void onFailure(Throwable caught) { Window.alert("System Error!"); } public void onSuccess(Object result) { List list = (List) result; statesListBoxModel.setEntries(list); } );

RPC related Links Complete source code LocationService.java LocationServiceAsync.java LocationServiceImpl.java LocationServiceUtil.java Client Code RPC Tutorial

Extending Widgets for more events onBrowserEvent(Event event) Widget FocusWidget ListBox

Extending Widgets for more events Some Facts about ListBox widget – Following Listeners can be added Change Focus Keyboard – Extends FocusWidget which extends Widget – ListBox does not receive a DoubleClick event as it never sinks it.

Extending Widgets for more events Some Facts about Widget class – A Widget needs to sink events in its constructor to receive it – Widget class has an important method void onBrowserEvent(Event event) which handles all the events (eventually)

Extending Widgets for more events Some Facts about Widget class – If a Widget needs to receive a DoubleClick event it needs to call sinkEvents(Event.ONDBLCLICK) – If a Widget needs to handle this new DoubleClick event it needs to override onBrowserEvent method and handle this event

Extending Widgets for more events # dblClickListenerCollection + AdvListBox() # onBrowserEvent(Event event) AdvListBoxListBox addDblClickListener() removeDblClickListener() fireDblClickEvent(Widget sender) DblClickListenerCollectionArrayList Void onDoubleClick(Widget sender) DblClickListener > 0..* 1

Extending Widgets for more events public class AdvListBox extends ListBox { private DoubleClickListenerCollection dblClickListeners = new DoubleClickListenerCollection(); public AdvListBox() { this.sinkEvents(Event.ONDBLCLICK); } public void onBrowserEvent(Event event) { super.onBrowserEvent(event); if(DOM.eventGetType(event)==Event.ONDBLCLICK){ dblClickListeners.fireDoubleClickEvent(this); } public void add(DoubleClickListener listener) { dblClickListeners.add(listener); } public void remove(DoubleClickListener listener) { dblClickListeners.remove(listener); } AdvListBox.java Source

Extending Widgets for more events Source files AdvListBox.java AdvListBoxDemo.java DoubleClickListener.java DoubleClickListenerCollection.java

Open Source GWT Libraries Demos MyGWT – Many Rich UI widgets MyGWT GWT-DND – Meant for drag and drop GWT-DND

MyGWT

GWT-DND