| CARVIEW |
|
wizard-framework
|
| Summary | Swing Wizard Framework |
|---|---|
| Categories | None |
| License | Lesser General Public License (LGPL) |
| Owner(s) | pietschy |
A Swing wizard library for Java based on a WizardModel and a number of WizardSteps. The library comes with three models that can be extended, they are as follows.
- StaticModel - The most basic model.
- DynamicModel - Similar to the static model, except that steps can be skiped dynamically at runtime based on the users response.
- MultiPathModel - The most complex model, similar to the dynamic model, except that steps are grouped into paths, and paths are linked together.
Todo
- Improved documentation
- Move colors etc to UIManager properties.
Other Libraries I've Developed
GUI Commands - A comprehensive command framework for swing (Commercial/Free for non commercial)
ExplicitTableBuilder - A powerful Swing layout builder based on ExplicitLayout (LGPL).
Participation
Please feel free to join as an observer, download the code and hack away. Please note that developer roles are reserved for existing project members who have sumbmitted qualitly patches.
Downloads
CHANGES.TXT
wizard-0.1.12.jar
wizard-0.1.12-src.jar
wizard-0.1.12-docs.zip
Documentation
Screenshot

In this example I called wizard.setOverviewVisible(false) to hide the
overview panel. This particular example also uses another project of mine for the layout.
Donations
If you've found the Wizard Framework useful and you'd like to make a donation, you can use the Paypal button below. Please note there is absolutely no obligation to make a donation and that the library will remain free of charge.
Getting Started
For an example of a multipath wizard please see the javadoc for MultiPathModel.java.
1. Basic Usage
StaticModel model = new StaticModel();
model.add(new MyFirstStep());
model.add(...);
model.add(...);
Wizard wizard = new Wizard(model);
wizard.showInFrame("My first wizard");
Please read the javadoc for details on using the other standard models.
public class MyWizardStep
extends WizardStep
{
private MyModel model;
private JPanel mainView;
private JCheckBox agreeCheckbox;
private JTextArea license;
public MyWizardStep()
{
super("My First Step", "A summary of the first step");
// build and layout the components..
mainView = new JPanel();
agreeCheckbox = new JCheckBox("Agree");
license = new JTextArea();
mainView.setLayout(...);
mainView.add(agreeCheckbox);
...
// listen to changes in the state..
agreeCheckbox.addItemListener(new ItemListener()
{
public void itemSelected(ItemEvent e)
{
// only continue if they agree
MyWizardStep.this.setComplete(agreeCheckbox.isSelected());
}
});
}
public void init(WizardModel model)
{
this.model = (MyModel) model;
}
public void prepare()
{
// load our view...
setView(mainView);
}
public void applyState()
throws InvalidStateException
{
// display a progress bar of some kind..
setView(myProgressView);
setBusy(true);
try
{
// do some work on another thread.. see Foxtrot
...
}
finally
{
setBusy(false);
}
// if error then throw an exception
if (!ok)
{
// restore our original view..
setView(mainView)
// The wizard will display this message to the user.
// You can prevent this by calling invalidStateException.setShowUser(false)
throw new InvalidStateException("That didn't work!");
}
// all is well so update the model
model.setAcceptsLicense(agreeCheckbox.isSelected());
}
public void getPreferredSize()
{
// use the size of our main view...
mainView.getPreferredSize();
}
}
| Powered by CollabNet | Feedback |
FAQ |
Press |
Developer tools
© 1995 - 2007 CollabNet. CollabNet is a registered trademark of CollabNet, Inc. |
