- Google Web Toolkit 2 Application Development Cookbook
- Shamsuddin Ahammad
- 461字
- 2025-02-21 00:27:09
Ext GWT is a Java UI component library developed by Ext JS, Inc. for building rich web applications with the Google Web Toolkit.
Its important features include the following:
- High performance, customizable UI components, panels, windows, menus, and so on
- Standard CSS support
- Well-documented source code
- Native GWT solution without any external JavaScript or third-party libraries
- Full remote procedure support using GWT RPC, JSON, and XML
- Support for Java 1.5 features, including generics, enums, and varargs
- Commercial and open source licenses available
Download Ext GWT SDK from http://www.sencha.com/products/gwt/download.php.
The file gxt-2.1.1-gwt2.zip
is the EXT GWT 2.1.1 PUBLIC RELEASE for GWT 2.
- Extract
gxt-2.1.1-gwt2.zip
toC:\Program Files\
or any other desired location. - The next step is to add the Ext GWT library in the Sales Processing System project. To do this:
- Right-click on Libraries under the Project tab, and click on Add Jar/Folder
- Open the
gxt.jar
file fromC:\Program Files\gxt-2.1.1-gwt2\gxt-2.1.1
(or from the location to which the file was extracted), as shown in the following three screenshots:
- The next step is to place the Ext GWT
resources
folder containing the CSS, images, and others into theweb
folder of theSales Processing System
project.- Copy the folder resources from
C:\Program Files\gxt-2.1.1-gwt2\gxt-2.1.1(or
from the location to which the file was extracted)
- Copy the folder resources from
- Paste it in the web folder by going to the Files tab, as shown in the following screenshot:
- Now, we need to modify the GWT module:
- Open
Main.gwt.xml
from Source Packages | com.packtpub - Expand the General node:
- Click on Add and write the module name
com.extjs.gxt.ui.GXT:
- Save and close
Main.gwt.xml
- Modify
welcomeGWT.html
to add a link to the CSS in the /web/resources/css folder - Open
welcomeGWT.html
- Add the following line just above the
</head> tag:
<link rel="stylesheet" type="text/css" href="resources/css/gxt-all.css" />
- Open
Now, we are ready to start developing the GWT application
Let's explain how these steps allow us to complete the task or solve the problem.
Adding the GXT JAR file allows us to use the widget library to create the user interfaces. Some important widgets used in this book from this library are Grids, Panels, Tabs, Layouts, Forms, Toolbar, Menu bar, Fields, Buttons, and so on.
The resources folder in the GXT contains the required CSS used in the widget library, images, and so on. By placing this folder in our application, we are being able to create nice user interfaces even without using any new CSS or images, though we can do so if required.
- Google Web Toolkit Overview, available at http://code.google.com/webtoolkit/overview.html
- Google Web Toolkit (GWT), by Mark Volkmann, available at http://java.ociweb.com/mark/other-presentations/GWT.pdf
- Google Web Toolkit, available at http://en.wikipedia.org/wiki/Google_Web_Toolkit
- GlassFish Wiki, available at http://wiki.glassfish.java.net
- About MySQL, available at http://www.mysql.com/about
- NetBeans IDE 6.8 Release Information, available at http://netbeans.org/community/releases/68
- GWT4NB, available at https://gwt4nb.dev.java.net
- Ext GWT, available at http://www.sencha.com/products/gwt/