GWT-Wizard is a wizard widget for use in your own GWT projects. It tries to make as few assumptions as possible about your needs, making it a flexible and powerful tool, while still providing sane defaults that allow simple projects to get up and running with as little configuration as possible.
GWT-Wizard has a few nice features, including the following:
- Flexible view component: use the built in view, or provide your own by implementing provided interfaces.
- Support for lazy-loading wizard pages: if you don't want to attach your
wizard's pages to the DOM right away, enable lazy loading and attachment
and extend
LazyComposite
for your page widgets. - Useful transition hooks for each of your pages: use methods like
beforeShow()
andbeforeNext()
to do setup, cleanup, validation and more in your pages. Cancel page navigation via the providedNavigationEvent
if you want to cancel a page transition. Set up two-way links between pages based on user input. - Flexible behavior with sane defaults: GWT-Wizard lets you customize virtually every element of your wizard, from how it looks to how it behaves. But, if you just want a simple, linear wizard, you don't have to customize anything.
Getting started with GWT-Wizard is easy:
- Build the project (see below) or download a JAR from the project's home page.
- Put
gwt-wizard.jar
on your project's build path - Inherit the wizard module with
<inherits name='net.binarymuse.gwt.Wizard' />
- Extend
WizardContext
to define your context object - Create one or more page for your wizard (a single-page wizard seems kinda
silly) by extending
WizardPage
(the only methods you must provide aregetTitle()
,getPageID()
, andasWidget()
) - Create a new wizard with
new Wizard("Wizard Title", contextObject)
(you can also pass a custom view if you so wish) - Call
wizard.addPage()
for each of the pages you wish to add to your wizard - Attach the wizard to the DOM
You can find code samples, working examples, and more at the GWT-Wizard's home on the web.
GWT-Wizard should be considered alpha software. The API is highly malleable and may change from commit to commit.
Assuming you have GWT installed to /path/to/gwt/gwt-x.y.z/
and Apache
Ant installed:
- Clone the project and change to the project directory:
git clone git://github.com/BinaryMuse/gwt-wizard.git && cd gwt-wizard
- Specify the path of the GWT library:
export GWTPATH=/path/to/gwt/gwt-x.y.z/
- Run the Ant script to build the project and create a JAR:
ant jar
The build.xml
file supplies several Apache Ant build targets:
- Target Command:
ant compile
- Task: Compile the GWT-Wizard project and copy both the uncompiled source
files and the compiled class files to the directory
bin
. - Depends On:
- GWT installed to
/path/to/gwt/gwt-x.y.z/
- Environment variable
GWTPATH
set to the value/path/to/gwt/gwt-x.y.z/
- GWT installed to
- Cleaning:
ant clean
- Target Command:
ant jar
- Task: Package the uncompiled source and compiled class files into a JAR
named
gwt-wizard.jar
. - Depends On:
- Target
compile
- Target
- Cleaning:
ant clean-jar
- Target Command:
ant doc
- Task: Create the GWT-Wizard JavaDoc in the directory
doc
. - Depends On: none
- Cleaning:
ant clean-doc
- Target Command:
ant site
- Task: Compile the GWT-Wizard site (http://gwt-wizard.binarymuse.net)
into the directory
pages-source/output
. Copies the JavaDoc if thedoc
task is ran first. - Depends On:
- Cleaning:
ant clean-site
- Target Command:
ant clean-all
- Task: Run all the
clean
targets
There are a few things missing from the current iteration of GWT-Wizard:
- Removing pages: once a page has been added to a wizard, it can't be removed
- DOM dependence: there is some DOM/GWT dependence in classes that should be a presenter (in the MVP sense)
- Unit Tests: there are currently no unit tests checked in for the project
GWT-Wizard is licensed under the MIT License. See the LICENSE file for details.