Class WizardDescriptor
- All Implemented Interfaces:
org.openide.util.HelpCtx.Provider
Related Tutorial
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Special iterator that works on an array ofPanel
s.static interface
Iterator for a wizard that needs to somehow instantiate new objects outside ATW queue.static interface
A special interface for panels that need to do additional asynchronous validation when Next or Finish button is clicked.static interface
Iterator for a wizard that will create new objects after the wizard has been closed.static interface
A special interface for panels that need to do additional asynchronous validation when Next or Finish button is clicked.static interface
A special interface for panel that needs to dynamically enabled Finish button.static interface
Deprecated.4.28 Use FinishablePanel instead.static interface
Iterator for a wizard that needs to somehow instantiate new objects.static interface
Iterator on the sequence of panels.static interface
One wizard panel with a component on it.static interface
Iterator for a wizard that wants to notify users while instantiate is running by a progress bar.static interface
A special interface for panels that need to do additional validation when Next or Finish button is clicked.Nested classes/interfaces inherited from class org.openide.NotifyDescriptor
NotifyDescriptor.ComposedInput, NotifyDescriptor.Confirmation, NotifyDescriptor.Exception, NotifyDescriptor.InputLine, NotifyDescriptor.Message, NotifyDescriptor.PasswordLine, NotifyDescriptor.QuickPick
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Object
"Finish" button option.static final Object
"Next" button option.static final Object
"Previous" button option.static final String
Set totrue
for enabling other properties.static final String
Set background color of content pane.static final String
Represents array of content items.static final String
Set totrue
for showing content pane (steps) in the left pane.static final String
Set foreground color of content pane.static final String
Set totrue
for displaying numbers in the content.static final String
Represents index of content item which will be highlighted.static final String
Error message that is displayed at the bottom of the wizard.static final String
Set totrue
for showing help pane (HTML browser) in the left pane.static final String
Represents URL of help displayed in left pane.static final String
Set the image which will be displayed in the left pane (behind the content).static final String
Set the side where the image should be drawn.static final String
Informational message that is displayed at the bottom of the wizard.static final String
Dimension of left pane, should be same as dimension ofPROP_IMAGE
.static final String
Warning message that is displayed at the bottom of the wizard.Fields inherited from class org.openide.DialogDescriptor
BOTTOM_ALIGN, DEFAULT_ALIGN, PROP_BUTTON_LISTENER, PROP_CLOSING_OPTIONS, PROP_HELP_CTX, PROP_LEAF, PROP_MODAL, PROP_OPTIONS_ALIGN, RIGHT_ALIGN
Fields inherited from class org.openide.NotifyDescriptor
CANCEL_OPTION, CLOSED_OPTION, DEFAULT_OPTION, ERROR_MESSAGE, INFORMATION_MESSAGE, NO_OPTION, OK_CANCEL_OPTION, OK_OPTION, PLAIN_MESSAGE, PROP_DETAIL, PROP_ERROR_NOTIFICATION, PROP_INFO_NOTIFICATION, PROP_MESSAGE, PROP_MESSAGE_TYPE, PROP_NO_DEFAULT_CLOSE, PROP_OPTION_TYPE, PROP_OPTIONS, PROP_TITLE, PROP_VALID, PROP_VALUE, PROP_WARNING_NOTIFICATION, QUESTION_MESSAGE, WARNING_MESSAGE, YES_NO_CANCEL_OPTION, YES_NO_OPTION, YES_OPTION
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructor for subclasses.<Data>
WizardDescriptor
(WizardDescriptor.Iterator<Data> panels, Data settings) Create wizard for a sequence of panels, passing some settings to the panels.Create wizard for a sequence of panels, with settings defaulted tothis
.<Data>
WizardDescriptor
(WizardDescriptor.Panel<Data>[] wizardPanels, Data settings) Create a new wizard from a fixed list of panels, passing some settings to the panels.WizardDescriptor
(WizardDescriptor.Panel<WizardDescriptor>[] wizardPanels) Create a new wizard from a fixed list of panels with settings defaulted tothis
. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Cancels the wizard - if Cancel button is enabled.final void
Finishes the wizard - if Finish button is enabled.final void
Moves the wizard to its next panel - if Next button is enabled.final void
Moves the wizard to its previous panel - if Previous button is enabled.Returns set of newly instantiated objects if the wizard has been correctly finished.Read only map with stored properties.getProperty
(String name) Getter for stored property.Getter for current format to be used to format title.getValue()
Overriden to ensure that returned value is one of the XXX_OPTION constants.protected void
Initializes settings.void
putProperty
(String name, Object value) Allows Panels that use WizardDescriptor as settings object to store additional settings into it.void
setAdditionalOptions
(Object[] options) Define an explicit description of the set of additional user-selectable options.void
setClosingOptions
(Object[] options) Setter for list of options that close the dialog.void
setHelpCtx
(org.openide.util.HelpCtx helpCtx) Set new help context for this dialog descriptor.void
setOptions
(Object[] options) Set options permitted by the wizard considered as aDialogDescriptor
.final void
setPanels
(WizardDescriptor.Iterator panels) Deprecated.use setPanelsAndSettings if needed.final <Data> void
setPanelsAndSettings
(WizardDescriptor.Iterator<Data> panels, Data settings) Set a different list of panels.void
setTitleFormat
(MessageFormat format) Sets the message format to create title of the wizard.void
Overrides superclass method.protected void
Updates buttons to reflect the current state of the panels.Methods inherited from class org.openide.DialogDescriptor
getButtonListener, getClosingOptions, getHelpCtx, getOptionsAlign, isLeaf, isModal, setButtonListener, setLeaf, setModal, setOptionsAlign
Methods inherited from class org.openide.NotifyDescriptor
addPropertyChangeListener, createNotificationLineSupport, firePropertyChange, getAdditionalOptions, getDefaultValue, getMessage, getMessageType, getNotificationLineSupport, getOptions, getOptionType, getTitle, getTitleForType, isNoDefaultClose, isValid, removePropertyChangeListener, setMessage, setMessageType, setNoDefaultClose, setOptionType, setTitle, setValid
-
Field Details
-
NEXT_OPTION
-
FINISH_OPTION
-
PREVIOUS_OPTION
-
PROP_AUTO_WIZARD_STYLE
Set totrue
for enabling other properties. It is relevant only on initialization (client property in first panel). Recommended to be set totrue
in most cases, then wizard can display wizard steps on the left side, create a subtitle on active panel, display of error messages and others. When false or not present in JComponent.getClientProperty(), then supplied panel is used directly without content, help or panel name auto layout. The value is taken fromWizardDescriptor.getProperty()
or((JComponent)Panel.getComponent()).getClientProperty()
in this order.Boolean
type property.- Since:
- 7.8
- See Also:
-
PROP_HELP_DISPLAYED
Set totrue
for showing help pane (HTML browser) in the left pane. It is relevant only on initialization (client property in first panel). Help content will be taken from propertyPROP_HELP_URL
. The value is taken fromWizardDescriptor.getProperty()
or((JComponent)Panel.getComponent()).getClientProperty()
in this order.Boolean
type property.- Since:
- 7.8
- See Also:
-
PROP_CONTENT_DISPLAYED
Set totrue
for showing content pane (steps) in the left pane. It is relevant only on initialization (client property in first panel). Content will be constructed from propertyPROP_CONTENT_DATA
. The value is taken fromWizardDescriptor.getProperty()
or((JComponent)Panel.getComponent()).getClientProperty()
in this order.Boolean
type property.- Since:
- 7.8
- See Also:
-
PROP_CONTENT_NUMBERED
Set totrue
for displaying numbers in the content. It is relevant only on initialization (client property in first panel). The value is taken fromWizardDescriptor.getProperty()
or((JComponent)Panel.getComponent()).getClientProperty()
in this order.Boolean
type property.- Since:
- 7.8
- See Also:
-
PROP_CONTENT_SELECTED_INDEX
Represents index of content item which will be highlighted. The value is taken fromWizardDescriptor.getProperty()
or((JComponent)Panel.getComponent()).getClientProperty()
in this order.Integer
type property.- Since:
- 7.8
- See Also:
-
PROP_CONTENT_DATA
Represents array of content items. The value is taken fromWizardDescriptor.getProperty()
or((JComponent)Panel.getComponent()).getClientProperty()
in this order.String[]
type property.- Since:
- 7.8
- See Also:
-
PROP_CONTENT_BACK_COLOR
Set background color of content pane. The value is taken fromWizardDescriptor.getProperty()
or((JComponent)Panel.getComponent()).getClientProperty()
in this order.Color
type property.- Since:
- 7.8
- See Also:
-
PROP_CONTENT_FOREGROUND_COLOR
Set foreground color of content pane. The value is taken fromWizardDescriptor.getProperty()
or((JComponent)Panel.getComponent()).getClientProperty()
in this order.Color
type property.- Since:
- 7.8
- See Also:
-
PROP_IMAGE
Set the image which will be displayed in the left pane (behind the content). The value is taken fromWizardDescriptor.getProperty()
or((JComponent) Panel.getComponent()).getClientProperty()
in this order.java.awt.Image
type property.- Since:
- 7.8
- See Also:
-
PROP_IMAGE_ALIGNMENT
Set the side where the image should be drawn. The value is taken fromWizardDescriptor.getProperty()
or((JComponent) Panel.getComponent()).getClientProperty()
in this order.String
type property.- Since:
- 7.8
- See Also:
-
PROP_LEFT_DIMENSION
Dimension of left pane, should be same as dimension ofPROP_IMAGE
. It is relevant only on initialization (client property in first panel). The value is taken fromWizardDescriptor.getProperty()
or((JComponent) Panel.getComponent()).getClientProperty()
in this order.Dimension
type property.- Since:
- 7.8
- See Also:
-
PROP_HELP_URL
Represents URL of help displayed in left pane. The value is taken fromWizardDescriptor.getProperty()
or((JComponent) Panel.getComponent()).getClientProperty()
in this order.URL
type property.- Since:
- 7.8
- See Also:
-
PROP_ERROR_MESSAGE
Error message that is displayed at the bottom of the wizard. Message informs user why the panel is invalid and possibly why the Next/Finish buttons were disabled. The property must be set to null value to clear the message. The value is taken fromWizardDescriptor.getProperty()
.String
type property.- Since:
- 7.8
- See Also:
-
PROP_WARNING_MESSAGE
Warning message that is displayed at the bottom of the wizard. Message informs user about possible non fatal problems with current enterd values in the wizard panel. Next/Finish buttons are usually enabled. The property must be set to null value to clear the message. The value is taken fromWizardDescriptor.getProperty()
.String
type property.- Since:
- 7.8
- See Also:
-
PROP_INFO_MESSAGE
Informational message that is displayed at the bottom of the wizard. Message informs user usually about need to fill some field or similar requirements or other non fatal problems. Next/Finish button are usually enabled. The property must be set to null value to clear the message. The value is taken fromWizardDescriptor.getProperty()
.String
type property.- Since:
- 7.8
- See Also:
-
-
Constructor Details
-
WizardDescriptor
Create a new wizard from a fixed list of panels, passing some settings to the panels.- Parameters:
wizardPanels
- the panels to usesettings
- the settings to pass to panels, ornull
- See Also:
-
WizardDescriptor
Create a new wizard from a fixed list of panels with settings defaulted tothis
.- Parameters:
wizardPanels
- the panels to use- See Also:
-
WizardDescriptor
Create wizard for a sequence of panels, passing some settings to the panels.- Parameters:
panels
- iterator over allWizardDescriptor.Panel
s that can appear in the wizardsettings
- the settings to provide to the panels (may be any data understood by them)- See Also:
-
WizardDescriptor
protected WizardDescriptor()Constructor for subclasses. The expected use is to call this constructor and then callsetPanelsAndSettings(org.openide.WizardDescriptor.Iterator<Data>, Data)
to provide the right iterator, panels and data the wizard should use. This allows to eliminate unchecked warnings as described in bug #102261.- Since:
- 7.4
-
WizardDescriptor
Create wizard for a sequence of panels, with settings defaulted tothis
.- Parameters:
panels
- iterator over allWizardDescriptor.Panel
s that can appear in the wizard
-
-
Method Details
-
initialize
-
setPanels
Deprecated.use setPanelsAndSettings if needed.Set a different list of panels. Correctly updates the buttons.- Parameters:
panels
- the new list ofWizardDescriptor.Panel
s
-
setPanelsAndSettings
public final <Data> void setPanelsAndSettings(WizardDescriptor.Iterator<Data> panels, Data settings) Set a different list of panels. Correctly updates the buttons.- Parameters:
panels
- the new list ofWizardDescriptor.Panel
ssettings
- the new settings that will be passed to the panels- Since:
- 7.2
-
setOptions
Set options permitted by the wizard considered as aDialogDescriptor
. Substitutes tokens such asNEXT_OPTION
with the actual button.- Overrides:
setOptions
in classNotifyDescriptor
- Parameters:
options
- the options to set- See Also:
-
setAdditionalOptions
Description copied from class:NotifyDescriptor
Define an explicit description of the set of additional user-selectable options. Additional options are supposed to be used for help button, etc.The usual value for the options parameter is an array of
String
s. But the parameter type is an array ofObject
s. Its interpretation depends on its type:- Overrides:
setAdditionalOptions
in classNotifyDescriptor
- Parameters:
options
- the options to set- See Also:
-
setClosingOptions
Description copied from class:DialogDescriptor
Setter for list of options that close the dialog. Special values are:- null - all options will close the dialog
- empty array - no option will close the dialog
- Overrides:
setClosingOptions
in classDialogDescriptor
- Parameters:
options
- the options to set
-
getValue
Overriden to ensure that returned value is one of the XXX_OPTION constants.- Overrides:
getValue
in classNotifyDescriptor
- Returns:
- an
Object
indicating the option selected by the user - See Also:
-
setTitleFormat
Sets the message format to create title of the wizard. The format can take two parameters. The name of the current component and the name returned by the iterator that defines the order of panels. The default value is something like{0} wizard {1}
That can be expanded to something like thisEJB wizard (1 of 8)
This method allows anybody to provide own title format.- Parameters:
format
- message format to the title
-
getTitleFormat
Getter for current format to be used to format title.- Returns:
- the format
- See Also:
-
putProperty
-
getProperty
-
getProperties
Read only map with stored properties.- Returns:
- read only map of properties stored using
putProperty(java.lang.String, java.lang.Object)
method - Since:
- 7.2
-
setHelpCtx
public void setHelpCtx(org.openide.util.HelpCtx helpCtx) Description copied from class:DialogDescriptor
Set new help context for this dialog descriptor. Fires property change event if successful.The implementation should automatically display a help button among the secondary options, without your needing to specify it, if the help context on the descriptor is neither
null
norHelpCtx.DEFAULT_HELP
. If the descriptor isnull
, this feature will be disabled (you can still add your own help button manually if you wish, of course). IfDEFAULT_HELP
(the default), normally the button will also be disabled, however if the inner pane is a component and this component has anassociated
help ID, that will be used automatically. So most users should never need to manually add a help button: call this method with the correct context, or associate an ID with the displayed component. Note that to set it tonull
you must explicitly call this method; passingnull
in the constructor actually sets it toDEFAULT_HELP
.- Overrides:
setHelpCtx
in classDialogDescriptor
- Parameters:
helpCtx
- new help context, can benull
(no help)- See Also:
-
getInstantiatedObjects
Returns set of newly instantiated objects if the wizard has been correctly finished. Returns the empty set as default. If the wizard uses the InstantiatingIterator then WizardDescriptor returns a set of Object as same as InstantiatingIterator.instantiate().- Returns:
- a set of Objects created
- Throws:
IllegalStateException
- if this method is called on the unfinished wizard- Since:
- 4.41
-
updateState
protected void updateState()Updates buttons to reflect the current state of the panels. Can be overridden by subclasses to change the options to special values. In such a case use:super.updateState (); setOptions (...);
-
setValue
Overrides superclass method. Adds reseting of wizard forCLOSED_OPTION
.- Overrides:
setValue
in classNotifyDescriptor
- Parameters:
value
- the chosen value- See Also:
-
doNextClick
public final void doNextClick()Moves the wizard to its next panel - if Next button is enabled. Always call this method from EDT thread.- Since:
- 7.19
-
doPreviousClick
public final void doPreviousClick()Moves the wizard to its previous panel - if Previous button is enabled. Always call this method from EDT thread.- Since:
- 7.19
-
doFinishClick
public final void doFinishClick()Finishes the wizard - if Finish button is enabled. Always call this method from EDT thread.- Since:
- 7.19
-
doCancelClick
public final void doCancelClick()Cancels the wizard - if Cancel button is enabled. Always call this method from EDT thread.- Since:
- 7.19
-