Description
Enables a wizard facility based on https://wizard.dev.java.net/.
Installation
The current version of griffon-wizard-plugin is 0.4
To install just issue the following command
Usage
The wizard plugin adds 1 node factory and a explicit method to Griffon's CompositeBuilder.
Node |
Property |
Type |
Default |
Required |
Bindable |
Notes |
|---|---|---|---|---|---|---|
wizard |
url |
URL |
|
|
||
|
file |
File |
|
can also be a |
||
|
inputStream |
InputStream |
|
|
||
|
image |
BufferedImage |
|
|
||
|
resource |
String |
|
|
||
|
class |
Class |
|
only required if |
||
|
title |
String |
|
|
||
|
pages |
List |
|
a List of Strings |
||
|
panelProvider |
String |
|
the name of a WizardPanelProvider class |
||
|
|
|
|
|
|
specify one of |
branchingWizard |
url |
URL |
|
|
||
|
file |
File |
|
can also be a |
||
|
inputStream |
InputStream |
|
|
||
|
image |
BufferedImage |
|
|
||
|
resource |
String |
|
|
||
|
class |
Class |
|
only required if |
||
|
|
|
|
|
|
specify one of |
|
|
|
|
|
|
value must be the logical name of BranchingWizard class |
Once installed you'll be able to create WizardPages with a new script create-wizard-page, WizardPages will be place at griffon-app/wizards. Other artifacts are available as well
Script |
Artifact |
|---|---|
create-wizard-page |
griffon/wizards/${NAME}WizardPage |
create-wizard-panel-provider |
griffon/wizards/${NAME}WizardPanelProvider |
create-branching-wizard |
griffon/wizards/${NAME}BranchingWizard |
create-wizard-result-producer |
griffon/wizards/${NAME}WizardResultproducer |
It is very important to set a name: property on each widget that serves as input, the Wizard will use it to automatically store any data that is entered by the user. The onValidate closure property will be used (if defined) to verify that entered data is valid, it will only be called whenever the target component is not null, be sure to verify which component is currently being validated (by checking against its name property for example).
Wizards must be created by setting title and pages/panelProvider properties, the rest of the aforementioned properties are used to customize the sidebar image.
You can customize the cancel and finish behavior of a wizard, either by setting a resultProducer: property, which should be an instance of WizardPage.WizardResultProducer or a Map with cancel: and finish: keys, or with a nested closure as shown next
You can also return a Summary object as a result of onFinish. Lastly you can display the wizard inside any controller with the following code
showWizard accepts 3 additional parameters
- helpAction (javax.swing.Action) - used as Action for the Help button.
- initialProperties (Map) - a map with default values to be used on the wizard, keys will match named widgets.
- location (java.awt.Rectangle) - location and size of the wizard.
|
|
History
Version |
Date |
Notes |
|---|---|---|
0.4 |
07-22-10 |
Release sync with Griffon 0.9 |
0.3 |
03-01-10 |
Upgraded to Griffon 0.3 |
0.2.1 |
03-09-09 |
Bumped version to be compatible with Griffon 0.1.0 |
0.2 |
02-05-09 |
Added Panelproviders and Branching Wizards. |
0.1 |
01-19-09 |
Initial release |


