HowTo Begin with GWT

Aus JSUG

Wechseln zu: Navigation, Suche

Inhaltsverzeichnis

[Bearbeiten] Setup

Go to http://code.google.com/webtoolkit/download.html and download the archive file. Unpack it and place the folder in a suitable directory (don't forget to change your PATH variable). The two most important files in there are the scripts applicationCreator and projectCreator. The first one creates your application -what a suprise- and the second one is used to additionally generate the necessery eclipse project files.

/path/to/JavaDev$ mkdir JsugGwtIntro

/path/to/JavaDev$ cd JsugGwtIntro

/path/to/JavaDev/JsugGwtIntro$ projectCreator -eclipse JsugGwtIntro
Created directory /path/to/JavaDev/JsugGwtIntro/src
Created directory /path/to/JavaDev/JsugGwtIntro/test
Created file /path/to/JavaDev/JsugGwtIntro/.project
Created file /path/to/JavaDev/JsugGwtIntro/.classpath

/path/to/JavaDev/JsugGwtIntro$ applicationCreator -eclipse JsugGwtIntro at.fsinf.jsug.gwt.intro.client.MyApplication
Created directory /path/to/JavaDev/JsugGwtIntro/src/at/fsinf/jsug/gwt/intro
Created directory /path/to/JavaDev/JsugGwtIntro/src/at/fsinf/jsug/gwt/intro/client
Created directory /path/to/JavaDev/JsugGwtIntro/src/at/fsinf/jsug/gwt/intro/public
Created file /path/to/JavaDev/JsugGwtIntro/src/at/fsinf/jsug/gwt/intro/MyApplication.gwt.xml
Created file /path/to/JavaDev/JsugGwtIntro/src/at/fsinf/jsug/gwt/intro/public/MyApplication.html
Created file /path/to/JavaDev/JsugGwtIntro/src/at/fsinf/jsug/gwt/intro/public/MyApplication.css
Created file /path/to/JavaDev/JsugGwtIntro/src/at/fsinf/jsug/gwt/intro/client/MyApplication.java
Created file /path/to/JavaDev/JsugGwtIntro/MyApplication.launch
Created file /path/to/JavaDev/JsugGwtIntro/MyApplication-shell.cmd
Created file /path/to/JavaDev/JsugGwtIntro/MyApplication-compile.cmd

/path/to/JavaDev/JsugGwtIntro$ 

You have to specify "client" as the package for your application, as it is a best practice recommended from google:

/path/to/JavaDev/JsugGwtIntro$ applicationCreator -eclipse JsugGwtIntro at.fsinf.jsug.gwt.intro.MyApplication
'at.fsinf.jsug.gwt.intro.MyApplication': Please use 'client' as the final package, as in 'com.example.foo.client.MyApp'.
It isn't technically necessary, but this tool enforces the best practice.
Google Web Toolkit 1.5.3
ApplicationCreator [-eclipse projectName] [-out dir] [-overwrite] [-ignore] [-addToClassPath classPathEntry] [-addModule module] className

where
  -eclipse         Creates a debug launch config for the named eclipse project
  -out             The directory to write output files into (defaults to current)
  -overwrite       Overwrite any existing files
  -ignore          Ignore any existing files; do not overwrite
  -addToClassPath  Adds extra elements to the class path.
  -addModule       Adds extra GWT modules to be inherited.
and
  className        The fully-qualified name of the application class to create

Project Structure

Finally you have a working project which you can import into eclipse and launch immediately.


[Bearbeiten] Widgets

TODO


[Bearbeiten] Events

TODO


[Bearbeiten] Links

Persönliche Werkzeuge