All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----com.ibm.as400.ui.framework.java.WizardManager
WizardManager
performs the following processing on behalf
of the application:
PanelManager
for each wizard panel
specified in the PDML, and attaches the panels to the wizard.
DataBean
accessor methods
identified in the PDML.
EventHandler
s
specified in the PDML with the appropriate UI components.
The total size of the wizard is a function of the size of the largest wizard panel.
To locate a wizard definition, WizardManager
needs three pieces of information:
WIZARD
tag in the PDML.
The framework first searches the specified location for a file with a name matching
the wizard name, and an extension of .pdml.ser
. If the serialized
wizard definition is not found, an attempt will be made to load a ResourceBundle
and a PDML file which correspond to the specified resource name. If the resources cannot
be located a DisplayManagerException
will be thrown.
The default path through the wizard panels is sequential. Applications may dynamically
customize the order in which panels are displayed. This is done by defining a class
that implements the WizardStateMachine
interface, and passing an instance
of this class to the WizardManager
.
If desired, a "task list" may be defined in the wizard definition. The task list will appear on the left-hand side of the wizard window, and will show the user's progress through the wizard by "checking off" each task as it is performed.
MyWizard
is defined in the file TestPanels.pdml
,
and that a properties file TestPanels.properties
is associated with the wizard
definition. Both files reside in the directory com/ourCompany/ourPackage
,
which is accessible from a directory defined in the classpath, or from a ZIP or JAR file
defined in the classpath. The following code creates the wizard and displays it:
import com.ibm.as400.ui.framework.java.*; // Create the wizard manager. Parameters: // 1. Resource name of the wizard definition // 2. Name of wizard // 3. List of DataBeans omitted // 5. Wizard navigation defaulted to sequential try { WizardManager wm = new WizardManager("com.ourCompany.ourPackage.TestPanels", "MyWizard", null, null); } catch (DisplayManagerException e) { e.displayUserMessage(null); System.exit(-1); } // Display the wizard wm.setVisible(true);Once the
DataBean
s that supply data to the wizard panels have been
implemented and the attributes have been identified in the PDML,
the following code may be used to construct a fully-functioning wizard:
import com.ibm.as400.ui.framework.java.*; import java.awt.Frame; // Instantiate the objects which supply data to the wizard TestDataBean1 db1 = new TestDataBean1(); TestDataBean2 db2 = new TestDataBean2(); // Initialize the objects db1.load(); db2.load(); // Set up to pass the objects to the UI framework DataBean[] dataBeans = { db1, db2 }; // Create an application-defined state machine for // customized navigation through the panels MyStateMachine sm = new MyStateMachine(); // Create the wizard manager. Parameters: // 1. Resource name of the wizard definition // 2. Name of wizard // 3. List of DataBeans // 4. Owner frame window // 5. Application-defined state machine Frame owner; ... try { WizardManager wm = new WizardManager("com.ourCompany.ourPackage.TestPanels", "MyWizard", dataBeans, owner, sm); } catch (DisplayManagerException e) { e.displayUserMessage(null); System.exit(-1); } // Display the wizard wm.setVisible(true);
java com.ibm.as400.ui.framework.java.WizardManager [-serialize] [-locale <language code>_<country code>_<variant>] <resource name> <wizard name>Options:
.pdml.ser
.
If this option is specified the wizard will not be displayed on the screen.
WIZARD
tag in the PDML document.
Examples:
java com.ibm.as400.ui.framework.java.WizardManager com.ourCompany.ourPackage.TestPanels MyWizard
java com.ibm.as400.ui.framework.java.WizardManager -serialize com.ourCompany.ourPackage.TestPanels MyWizard
java com.ibm.as400.ui.framework.java.WizardManager -locale en_UK com.ourCompany.ourPackage.TestPanels MyWizard
java com.ibm.as400.ui.framework.java.WizardManager -serialize -locale en_UK com.ourCompany.ourPackage.TestPanels MyWizard
WizardManager
object for the specified wizard,
and then serializes the wizard definition.
WizardManager
for the specified wizard,
using the specified container.
WizardManager
object for the specified wizard.
WizardManager
object for the specified wizard.
WizardManager
for the specified wizard,
using the specified container.
WizardManager
object for the specified wizard.
WizardManager
object for the specified wizard.
ActionListener
which is notified when
the user cancels out of a window.
ActionListener
which is notified when
commit processing is complete.
DataBean
s
which manage the data.
JavaComponentDescriptor
for the specified user interface component.
PaneManager
to which the receiver is delegating
management of the specified subpane.
WizardManager
.
DataBean
s which manage data for the
panel to verify that their data is in a consistent state.
PaneManager
for the receiver.
exit
.
WindowManager
.
show
.
public WizardManager(String baseName, String wizardName, DataBean dataBeans[], WizardStateMachine stateMachine) throws DisplayManagerException
WizardManager
object for the specified wizard.
The wizard will be modeless.
The default locale will be used to load the wizard definition.
WIZARD
tag in the PDML document
DataBean
s which supply data to the wizard (may be null)
public WizardManager(String baseName, Locale locale, String wizardName, DataBean dataBeans[], WizardStateMachine stateMachine) throws DisplayManagerException
WizardManager
object for the specified wizard.
The wizard will be modeless.
WIZARD
tag in the PDML document
DataBean
s which supply data to the wizard (may be null)
public WizardManager(String baseName, String wizardName, DataBean dataBeans[], Frame owner, WizardStateMachine stateMachine) throws DisplayManagerException
WizardManager
object for the specified wizard.
The wizard will be modal, with the specified Frame
as its owner.
The application will block on the call to setVisible
until
the wizard has closed.
The default locale will be used to load the wizard definition.
WIZARD
tag in the PDML document
DataBean
s which supply data to the wizard (may be null)
public WizardManager(String baseName, Locale locale, String wizardName, DataBean dataBeans[], Frame owner, WizardStateMachine stateMachine) throws DisplayManagerException
WizardManager
object for the specified wizard.
The wizard will be modal, with the specified Frame
as its owner.
The application will block on the call to setVisible
until
the wizard has closed.
WIZARD
tag in the PDML document
DataBean
s which supply data to the wizard (may be null)
public WizardManager(String baseName, String wizardName, DataBean dataBeans[], Container container, WizardStateMachine stateMachine) throws DisplayManagerException
WizardManager
for the specified wizard,
using the specified container.
This constructor allows the application to supply its own container, rather than
relying on this object to create a container of the appropriate type.
The default locale will be used to load the wizard definition.
WIZARD
tag in the PDML
DataBean
s which supply data to the wizard (may be null)
public WizardManager(String baseName, Locale locale, String wizardName, DataBean dataBeans[], Container container, WizardStateMachine stateMachine) throws DisplayManagerException
WizardManager
for the specified wizard,
using the specified container.
This constructor allows the application to supply its own container, rather than
relying on this object to create a container of the appropriate type.
WIZARD
tag in the PDML
DataBean
s which supply data to the wizard (may be null)
public WizardManager(String baseName, Locale locale, String wizardName) throws DisplayManagerException
WizardManager
object for the specified wizard,
and then serializes the wizard definition.
This constructor cannot be used to display the wizard.
If a null locale is specified, the default locale will be used to load the wizard definition. If resources for the default locale cannot be found, an attempt will be made to use the base resources for the wizard.
WIZARD
tag in the PDML
public static void main(String args[])
WizardManager
. See the class description.
public void serialize() throws IOException
<wizard name>_<locale string>.pdml.serwhere
<wizard name>
is the name of the wizard as specified on the WIZARD
tag in the PDML, and <locale string>
consists of the ISO Language Code,
ISO Country Code, and optional variant codes, each delimited by an underscore ("_") character.
public JButton getBackButton()
JButton
which represents this wizard's Back button
public JButton getNextButton()
JButton
which represents this wizard's Next button
public JButton getCancelButton()
JButton
which represents this wizard's Cancel button
public JButton getFinishButton()
JButton
which represents this wizard's Finish button
public void setExitOnClose(boolean exit)
exit
.
The default value is false
.
This method should be called before the wizard is made visible.
public boolean getExitOnClose()
public void setVisible(boolean show)
show
.
If an owner frame was specified on the constructor indicating that the wizard
is modal, the application will block on the call to setVisible
until the wizard has closed.
public boolean isVisible()
public Dimension getPreferredSize()
public void setFormatter(String componentName, DataFormatter formatter, boolean required)
<panel_name>.<component_name>
where panel_name
is the name of the panel containing
the desired component, and component_name
is the
name of the component, as defined in the PDML for the panel definition.
public DataFormatter getFormatter(String componentName)
<panel_name>.<component_name>
where panel_name
is the name of the panel containing
the desired component, and component_name
is the
name of the component, as defined in the PDML for the panel definition.
DataFormatter
, or null
if the component cannot be found
public String getTitle()
public void loadData()
WizardManager
doesn't participate in aggregates.
public void activatePanel()
WizardManager
isn't managed as a subpanel.
public void showPane(String paneName)
WizardManager
isn't managed as a subpanel.
public Component getComponent(String componentName)
<panel_name>.<component_name>
where panel_name
is the name of the panel containing
the desired component, and component_name
is the
name of the component, as defined in the PDML for the panel definition.
Component
, or null
if the component cannot be found
public JavaComponentDescriptor getComponentDescriptor(String componentName)
JavaComponentDescriptor
for the specified user interface component.
The name of the component must be of the form
<panel_name>.<component_name>
where panel_name
is the name of the panel containing
the desired component, and component_name
is the
name of the component, as defined in the PDML for the panel definition.
JavaComponentDescriptor
, or null
if the descriptor cannot be found
public PaneManager getDelegateManager(String paneName)
PaneManager
to which the receiver is delegating
management of the specified subpane.
This method has no implementation, since WizardManager
manages its own panels.
public void setAggregateManager(PaneManager mgr)
PaneManager
for the receiver.
This method has no implementation, since WizardManager
doesn't participate in aggregates.
public void applyChanges()
DataBean
s
which manage the data.
This method has no implementation, since WizardManager
doesn't participate in aggregates.
public void prepareToCommit(Vector preparedDataBeans)
DataBean
s which manage data for the
panel to verify that their data is in a consistent state.
This method has no implementation, since WizardManager
doesn't participate in aggregates.
public void commit(Vector committedDataBeans)
WizardManager
doesn't participate in aggregates.
public Window getWindow()
public void setModalRelativeTo(WindowManager mgr)
WindowManager
.
If the panel is not currently showing, the panel for this
WizardManager
is centered on the screen.
This method has no effect if it is called after this wizard is made visible.
WindowManager
managing the panel
in relation to which this object's panel location is determined
public void addCommitListener(ActionListener listener)
ActionListener
which is notified when
commit processing is complete.
This facility is provided for modeless windows, so that the
application may learn when the window has closed.
The listener's actionPerformed
method will be called following
successful completion of commit processing on the wizard.
The ActionEvent
passed to the listener object will
have its action command string set to "COMMIT".
This method is not recommended for modal windows, since the
application will be blocked on the setVisible
call until the window is closed.
ActionListener
to be notified
public void addCancelListener(ActionListener listener)
ActionListener
which is notified when
the user cancels out of a window.
This facility is provided for modeless windows, so that the
application may learn when the window has closed.
The listener's actionPerformed
method will be called when
the user cancels out of the wizard without committing any changes.
The ActionEvent
passed to the listener object will
have its action command string set to "CANCEL".
This method is not recommended for modal windows, since the
application will be blocked on the setVisible
call until the window is closed.
ActionListener
to be notified
public void setHelpPath(String path)
All Packages Class Hierarchy This Package Previous Next Index