ebook img

Google Web Toolkit: GWT Java AJAX Programming: A Practical Guide to Google Web Toolkit for Creating AJAX Applications with Java PDF

245 Pages·2007·5.88 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Google Web Toolkit: GWT Java AJAX Programming: A Practical Guide to Google Web Toolkit for Creating AJAX Applications with Java

G o o g Google Web Toolkit l e W e b Google Web Toolkit (GWT) is an open-source Java software development framework that makes writing AJAX applications like Google Maps and Gmail easy for developers who T don’t speak browser quirks as a second language. o o It concentrates on the serious side of AJAX: creating powerful, productive applications l for browser platforms. Google Web Toolkit shows you how to create reliable user inter- k faces that enhance the user experience. i t What you will learn from this book • Set up a GWT development environment in Eclipse • Create, test, debug, and deploy GWT applications • Develop custom widgets—examples include a calendar and a weather forecast widget F r o m T e c h n o l o g i e s t o S o l u t i o n s • Internationalize your GWT applications • Create complex interfaces using grids, moveable elements, and more • Integrate GWT with Rico, Moo.fx, and Script.aculo.us to create even more Google Web Toolkit attractive UIs using JSNI Who this book is written for P r a The book is aimed at programmers who want to use GWT to create interfaces for b their professional web applications. Readers will need experience writing non-trivial h applications using Java. Experience with developing web interfaces is useful, but a GWT Java AJAX Programming k knowledge of JavaScript and DHTML is not required… GWT takes care of that! a r C h a g A practical guide to Google Web Toolkit for creating a n AJAX applications with Java $ 44.99 US Packt Publishing t i £ 27.99 UK Birmingham - Mumbai www.packtpub.com Prices do not include local sales tax or VAT where applicable Prabhakar Chaganti Google Web Toolkit GWT Java AJAX Programming A practical guide to Google Web Toolkit for creating AJAX applications with Java Prabhakar Chaganti BIRMINGHAM - MUMBAI Google Web Toolkit GWT Java Ajax Programming Copyright © 2007 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: February 2007 Production Reference: 1150207 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-847191-00-7 www.packtpub.com Cover Image by www.visionwt.com Credits Author Project Manager Prabhakar Chaganti Patricia Weir Reviewers Project Coordinator Luca Masini Suneet Amrute Travis S. Schmidt Indexer Development Editor Bhushan Pangaonkar David Barnes Proofreader Assistant Development Editor Chris Smith Nikhil Bangera Layouts and Illustrations Technical Editors Shantanu Zagade Rashmi Phadnis Ved Prakash Jha Cover Designer Shantanu Zagade Editorial Manager Dipali Chittar About the Author Prabhakar Chaganti is an enterprise software architect and open-source evangelist working for a cutting-edge software company in the suburbs of Atlanta. His interests include Linux, Ruby, Python, Java, and Virtualization. He recently won the community choice award for the most innovative virtual appliance in the 2006 VMW—this award is the Ultimate Global Virtual Appliance Challenge. This book has gained immense support from various people. The staff at Packt Publishing were very helpful in providing key assistance to me and ably and enthusiastically led me through the various phases of this project. I would like to thank the technical reviewers for their comments, which have helped make this a much better book. The vibrant community around the GWT mailing list was very helpful whenever I needed clarifications on some of the more arcane corners of GWT. I would like to thank my wife Nitika for her support and constant encouragement while I was writing this book. She effortlessly played the roles of both mom and dad while I was wrestling with GWT! Thanks and love to my two daughters Anika and Anya for putting up with daddy being stuck to his laptop for long periods of time instead of playing with them. About the Reviewers Luca Masini was born in Florence in 1971. He is a senior software engineer and web architect. He has been heavily involved from the first days in the Java world as a consultant for the major Italian banks and firms, developing integration software, and as technical leader in many of the flagship projects. He worked for adoption of Sun's J2EE standard in an envinroment where COBOL was the leading language, and then he shifted his eyes toward open source, in particular IoC containers, ORM tools, and UI frameworks. As such he adopted early products like Spring, Hibernate, and Struts, giving customers a technlogical advantage. During last year he fell in love with GWT (of course !!) and he had to master a new project all done with Oracle's ADF Faces and JDeveloper as Visual IDE. I want to thank my son Jacopo for being my lovely son and my wife for being the best wife a man can dream. Travis S. Schmidt (BS, MBA) is currently employed as an Applications Developer at the University of Iowa Hygienic Laboratory. He has several years of experience in designing and developing web-based clients and recently deployed a system utilizing the Google Web Toolkit. I would like to thank my loving family: Rebecca, Jacqueline, and Alexander, for the their unwavering support. Table of Contents Preface 1 Chapter 1: Getting Started 7 Introduction to GWT 7 Basic Download 8 Time for Action—Downloading GWT 8 Exploring the GWT Samples 12 Time for Action—Getting into KitchenSink 12 GWT License 16 Summary 16 Chapter 2: Creating a New GWT Application 17 Generating a New Application 17 Time for Action—Using the ApplicationCreator 18 Generating a New Application with Eclipse Support 22 Time for Action—Modifying HelloGWT 22 Creating a Random Quote AJAX Application 25 Time for Action—Modifying Auto-Generated Applications 25 Running the Application in Hosted Mode 29 Time for Action—Executing the HelloGWT-Shell Script 30 Running the Application in Web Mode 31 Time for Action—Compile the Application 31 Summary 34 Chapter 3: Creating Services 35 Creating a Service Definition Interface 35 Time for Action—Creating a Prime Number Service 36 Creating an Asynchronous Service Definition Interface 37 Time for Action—Utilizing the AJAX Support 37 Table of Contents Creating a Service Implementation 38 Time for Action—Implement Our Service 38 Consuming the Service 42 Time for Action—Creating the Client 42 Summary 45 Chapter 4: Interactive Forms 47 Sample Application 47 Live Search 48 Time for Action—Search as you Type! 48 Password Strength Checker 55 Time for Action—Creating the Checker 55 Auto Form Fill 62 Time for Action—Creating a Dynamic Form 62 Sortable Tables 71 Time for Action—Sorting Table Rows 72 Dynamic Lists 79 Time for Action—Filtering Search Criteria 80 Flickr-Style Editable Labels 89 Time for Action—A Custom Editable Label 90 Summary 96 Chapter 5: Responsive Complex Interfaces 97 Pageable Tables 97 Time for Action—Interfacing a Dataset 98 Editable Tree Nodes 105 Time for Action—Modifying the Node 105 Log Spy 109 Time for Action—Updating a Log File 109 Sticky Notes 116 Time for Action—Playing with Sticky Notes 116 Jigsaw Puzzle 120 Time for Action—Let's Create a Puzzle! 120 Summary 126 Chapter 6: Browser Effects with JSNI and JavaScript Libraries 127 What is JSNI? 127 Moo.Fx 128 Time for Action—Using JSNI 129 Rico Rounded Corners 136 Time for Action—Supporting the Labels 136 Rico Color Selector 140 Time for Action—Wrapping the Color Methods 140 [ ii ] Table of Contents Script.aculo.us Effects 145 Time for Action—Applying Effects 146 Summary 152 Chapter 7: Custom Widgets 153 Calendar Widget 153 Time for Action—Creating a Calendar 154 Weather Widget 168 Time for Action—Creating a Weather Information Service 168 Summary 185 Chapter 8: Unit Tests 187 Test a GWT Page 187 Time for Action—Creating a Unit Test 187 Test an Asynchronous Service 191 Time for Action—Testing the Asynchronous Service 191 Test a GWT Page with an Asynchronous Service 194 Time for Action—Combining the Two 194 Create and Run a Test Suite 197 Time for Action—Deploying a Test Suite 197 Summary 199 Chapter 9: I18N and XML 201 Internationalization (I18N) 201 Time for Action—Using the I18N Support 201 Creating XML Documents 207 Time for Action—Creating an XML Document 208 Parse XML Documents 212 Time for Action—Parsing XML on the Client 213 Summary 216 Chapter 10: Deployment 217 Manual Deployment in Tomcat 217 Time for Action—Deploying a GWT Application 217 Automated Deployment Using Ant 222 Time for Action—Creating the Ant Build File 222 Deployment from Eclipse 225 Time for Action—Running Ant from Eclipse 225 Summary 228 Appendix A: Running the Samples 229 Index 231 [ iii ]

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.