| java.lang.Object org.netbeans.installer.wizard.Wizard
Wizard | public class Wizard (Code) | | This is the main class of the NBI Wizard framework. It represents the wizard as
a whole.
The wizard serves a the main source of the data input by the user. It is
organized as a series of pages, each either informing the user about something
or displaying an input field. The input validation also happens here.
The wizard is a singleton in some sense, i.e. only one instance of
Wizard can be created directly, via the
Wizard.getInstance() method. All other
instances that may be created during the course of wizard's workflow will be the
so-called child wizards.
The wizard operates over a list of
WizardComponent s. In order to add
"depth", the user needs to create sub-wizards which would have their own
sequences of components, but will appear as a single component to the parent
wizard. This effect can be obtained via the
org.netbeans.installer.wizard.components.WizardSequence component.
Context. Each wizard can have an associated context. A
Context is a
simple collection of objects which can be fetched by their class. The context is
assigned to a wizard at runtime, thus it is possible to switch contexts basing
on some conditions. The context is intended to be read-only, though it is
possible to add new objects to it. The most common usecase for a context would
be passing an instance of an object to all the components of a wizard.
Property container. Since the princial use case for a wizard is collecting some
user input, the values entered by the user need to be stored somewhere. For this
purpose a wizard has an associated
PropertyContainer . It serves as a
storage for the user-entered strings.
The root wizard instance will load its list of components from an URI defined in
the system property
Wizard.COMPONENTS_INSTANCE_URI_PROPERTY , if the property is
not set, then it falls back to the
Wizard.DEFAULT_COMPONENTS_INSTANCE_URI . For
child wizards, created with one of the
Wizard.createSubWizard(List,int) methods, expect that their lists of components
will be passed in directly. The list of components can be constructed using the
Wizard.loadWizardComponents(String) method.
author: Kirill Sorokin since: 1.0 |
Constructor Summary | |
public | Wizard() Default constructor. | public | Wizard(Wizard parent) Constructs a new instance of
Wizard with the given parent. | public | Wizard(Wizard parent, List<WizardComponent> components, int index) Constructs a new instance of
Wizard with the given parent, list of
WizardComponent and inital index of the active component. | public | Wizard(Wizard parent, List<WizardComponent> components, int index, PropertyContainer propertyContainer, ClassLoader classLoader) Constructs a new instance of
Wizard with the given parent, list of
WizardComponent , inital index of the active component, properties
container and classloader. |
ATTRIBUTE_CLASS | final public static String ATTRIBUTE_CLASS(Code) | | Name of the XML attribute which contains the classname of a component.
|
COMPONENTS_INSTANCE_URI_PROPERTY | final public static String COMPONENTS_INSTANCE_URI_PROPERTY(Code) | | Name of the system property which is expected to contain the URI which points
to the XML file with the list of components for the root wizard.
|
COMPONENTS_SCHEMA_URI_PROPERTY | final public static String COMPONENTS_SCHEMA_URI_PROPERTY(Code) | | Name of the system property which is expected to contain the URI which points
to the XML schema which defines the format for the serialized list of wizard
components.
|
CURRENT_COMPONENT_CLASSNAME_PROPERTY | final public static String CURRENT_COMPONENT_CLASSNAME_PROPERTY(Code) | | Name of the system property which will be set when a component executes. Its
value will be the fully qualified class name of the component.
|
DEFAULT_COMPONENTS_INSTANCE_URI | final public static String DEFAULT_COMPONENTS_INSTANCE_URI(Code) | | Default URI which points to the XML file with the list of components for the
root wizard.
|
DEFAULT_COMPONENTS_SCHEMA_URI | final public static String DEFAULT_COMPONENTS_SCHEMA_URI(Code) | | Default URI which points to the XML schema which defines the format for the
serialized list of wizard components.
|
TAG_COMPONENT | final public static String TAG_COMPONENT(Code) | | Name of the XML tag which describes an individual component.
|
TAG_COMPONENTS | final public static String TAG_COMPONENTS(Code) | | Name of the XML tag which describes a list of components.
|
TAG_PROPERTIES | final public static String TAG_PROPERTIES(Code) | | Name of the XMl tag which describes the properties of a component.
|
Wizard | public Wizard()(Code) | | Default constructor. Performs initialization of the basic properties, which,
however, is not enough for normal operation - the list of
WizardComponent is not initialized.
|
Wizard | public Wizard(Wizard parent)(Code) | | Constructs a new instance of
Wizard with the given parent. Most of
the properties of the new instance are inherited from the parent.
Parameters: parent - Parent Wizard. |
Wizard | public Wizard(Wizard parent, List<WizardComponent> components, int index)(Code) | | Constructs a new instance of
Wizard with the given parent, list of
WizardComponent and inital index of the active component.
Parameters: parent - Parent Wizard. Parameters: components - List of WizardComponents over which the wizardshould iterate. Parameters: index - Initial index of the active component. |
close | public void close()(Code) | | Closes the wizard. The current
WizardContainer is hidden and
deinitialized. No real action is taken if the UI mode is
UiMode.SILENT .
If the current wizard is not the ro ot one - the parent's
Wizard.close() method is called.
|
createSubWizard | public Wizard createSubWizard(List<WizardComponent> components, int index)(Code) | | Creates a new child (or sub-) wizard with the given list of
WizardComponent s and the initial index of the active component.
Parameters: components - List of WizardComponents over which the childwizard should iterate. Parameters: index - Initial index of the active component. New child (sub-) wizard. |
createSubWizard | public Wizard createSubWizard(List<WizardComponent> components, int index, PropertyContainer propertyContainer, ClassLoader classLoader)(Code) | | Creates a new child (or sub-) wizard with the given list of
WizardComponent s, initial index of the active component, property
container and class loader.
Parameters: components - List of WizardComponents over which the childwizard should iterate. Parameters: index - Initial index of the active component. Parameters: propertyContainer - PropertyContainer which should be used bythe child wizard. Parameters: classLoader - ClassLoader which should be used by the childwizard. New child (sub-) wizard. |
getIndex | public int getIndex()(Code) | | Returns the index of the currently active component.
Index of the currently active component. |
getProperty | public String getProperty(String name)(Code) | | Gets the value of the property with the given name. This method in turn calls
the
PropertyContainer.getProperty(String) method on the property
container used by this wizard instance.
Parameters: name - Name of the property whose value should be obtained. Value of the specified property, or null is the propertywith the given name does not exist. |
hasNext | public boolean hasNext()(Code) | | Checks whether there is exists a component which can be reached using the
Wizard.next() method. This method checks both the components of the
current wizard and the parent one.
true is there is a next element, false otherwise. |
hasPrevious | public boolean hasPrevious()(Code) | | Checks whether there is exists a component which can be reached using the
Wizard.previous() method. This method checks both the components of the
current wizard and the parent one.
true is there is a previous element, false otherwise. |
next | public void next()(Code) | | Proceeds to the next element in the wizard. If the next element is not
available and the current wizard instance is the root one, then the wizard is
considered to be at the last element and the wizard's
FinishHandler.finish is called.
If the current wizard is not the root instance and there is no next component,
then the parent wizard's
Wizard.next() method is called.
|
open | public void open()(Code) | | Opens the wizard. Depending on the current UI mode, an appropriate
WizardContainer is chosen, initialized and set to be visible. No
wizard container is created if the UI Mode is
UiMode.SILENT .
If the current wizard is not the root one - the parent's
Wizard.open() method is called.
|
openBlocking | public void openBlocking()(Code) | | Opens the wizard in a blocking mode. As opposed to
Wizard.open() , this
method will not return the wizard is closed from another thread.
See Also: Wizard.open() |
previous | public void previous()(Code) | | Moves to the previous element in the wizard. If the previous component is not
available and the current wizard instance is the root one a critical error is
shown and the application terminates.
If the current wizard is not the root one and there is no previous component
in the current sequence, the parent's
Wizard.previous() method is called.
|
setProperty | public void setProperty(String name, String value)(Code) | | Sets the value of the property with the given name to the given value. This
method in turn calls the
PropertyContainer.setProperty(StringString) method on the property container used by this wizard instance.
Parameters: name - Name of the property whose value should be set. Parameters: value - New value for the property. |
|
|