public class WizardDescriptor extends DialogDescriptor
Related Tutorial
Modifier and Type | Class and Description |
---|---|
static class |
WizardDescriptor.ArrayIterator<Data>
Special iterator that works on an array of
Panel s. |
static interface |
WizardDescriptor.AsynchronousInstantiatingIterator<Data>
Iterator for a wizard that needs to somehow instantiate new objects outside ATW queue.
|
static interface |
WizardDescriptor.AsynchronousValidatingPanel<Data>
A special interface for panels that need to do additional
asynchronous validation when Next or Finish button is clicked.
|
static interface |
WizardDescriptor.BackgroundInstantiatingIterator<Data>
Iterator for a wizard that will create new objects after the wizard has been closed.
|
static interface |
WizardDescriptor.ExtendedAsynchronousValidatingPanel<Data>
A special interface for panels that need to do additional
asynchronous validation when Next or Finish button is clicked.
|
static interface |
WizardDescriptor.FinishablePanel<Data>
A special interface for panel that needs to dynamically enabled
Finish button.
|
static interface |
WizardDescriptor.FinishPanel<Data>
Deprecated.
4.28 Use FinishablePanel instead.
|
static interface |
WizardDescriptor.InstantiatingIterator<Data>
Iterator for a wizard that needs to somehow instantiate new objects.
|
static interface |
WizardDescriptor.Iterator<Data>
Iterator on the sequence of panels.
|
static interface |
WizardDescriptor.Panel<Data>
One wizard panel with a component on it.
|
static interface |
WizardDescriptor.ProgressInstantiatingIterator<Data>
Iterator for a wizard that wants to notify users while instantiate is running by a progress bar.
|
static interface |
WizardDescriptor.ValidatingPanel<Data>
A special interface for panels that need to do additional
validation when Next or Finish button is clicked.
|
NotifyDescriptor.ComposedInput, NotifyDescriptor.Confirmation, NotifyDescriptor.Exception, NotifyDescriptor.InputLine, NotifyDescriptor.Message, NotifyDescriptor.PasswordLine, NotifyDescriptor.QuickPick
Modifier and Type | Field and Description |
---|---|
static Object |
FINISH_OPTION
"Finish" button option.
|
static Object |
NEXT_OPTION
"Next" button option.
|
static Object |
PREVIOUS_OPTION
"Previous" button option.
|
static String |
PROP_AUTO_WIZARD_STYLE
Set to
true for enabling other properties. |
static String |
PROP_CONTENT_BACK_COLOR
Set background color of content pane.
|
static String |
PROP_CONTENT_DATA
Represents array of content items.
|
static String |
PROP_CONTENT_DISPLAYED
Set to
true for showing content pane (steps) in the left pane. |
static String |
PROP_CONTENT_FOREGROUND_COLOR
Set foreground color of content pane.
|
static String |
PROP_CONTENT_NUMBERED
Set to
true for displaying numbers in the content. |
static String |
PROP_CONTENT_SELECTED_INDEX
Represents index of content item which will be highlighted.
|
static String |
PROP_ERROR_MESSAGE
Error message that is displayed at the bottom of the wizard.
|
static String |
PROP_HELP_DISPLAYED
Set to
true for showing help pane (HTML browser) in the left pane. |
static String |
PROP_HELP_URL
Represents URL of help displayed in left pane.
|
static String |
PROP_IMAGE
Set the image which will be displayed in the left pane (behind the content).
|
static String |
PROP_IMAGE_ALIGNMENT
Set the side where the image should be drawn.
|
static String |
PROP_INFO_MESSAGE
Informational message that is displayed at the bottom of the wizard.
|
static String |
PROP_LEFT_DIMENSION
Dimension of left pane, should be same as dimension of
PROP_IMAGE . |
static String |
PROP_WARNING_MESSAGE
Warning message that is displayed at the bottom of the wizard.
|
BOTTOM_ALIGN, DEFAULT_ALIGN, PROP_BUTTON_LISTENER, PROP_CLOSING_OPTIONS, PROP_HELP_CTX, PROP_LEAF, PROP_MODAL, PROP_OPTIONS_ALIGN, RIGHT_ALIGN
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
Modifier | Constructor and Description |
---|---|
protected |
WizardDescriptor()
Constructor for subclasses.
|
|
WizardDescriptor(WizardDescriptor.Iterator<Data> panels,
Data settings)
Create wizard for a sequence of panels, passing some settings to the panels.
|
|
WizardDescriptor(WizardDescriptor.Iterator<WizardDescriptor> panels)
Create wizard for a sequence of panels, with settings
defaulted to
this . |
|
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 to
this . |
Modifier and Type | Method and Description |
---|---|
void |
doCancelClick()
Cancels the wizard - if Cancel button is enabled.
|
void |
doFinishClick()
Finishes the wizard - if Finish button is enabled.
|
void |
doNextClick()
Moves the wizard to its next panel - if Next button is enabled.
|
void |
doPreviousClick()
Moves the wizard to its previous panel - if Previous button is enabled.
|
Set |
getInstantiatedObjects()
Returns set of newly instantiated objects if the wizard has been correctly finished.
|
Map<String,Object> |
getProperties()
Read only map with stored properties.
|
Object |
getProperty(String name)
Getter for stored property.
|
MessageFormat |
getTitleFormat()
Getter for current format to be used to format title.
|
Object |
getValue()
Overriden to ensure that returned value is one of
the XXX_OPTION constants.
|
protected void |
initialize()
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(HelpCtx helpCtx)
Set new help context for this dialog descriptor.
|
void |
setOptions(Object[] options)
Set options permitted by the wizard considered as a
DialogDescriptor . |
void |
setPanels(WizardDescriptor.Iterator panels)
Deprecated.
use setPanelsAndSettings if needed.
|
<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 |
setValue(Object value)
Overrides superclass method.
|
protected void |
updateState()
Updates buttons to reflect the current state of the panels.
|
getButtonListener, getClosingOptions, getHelpCtx, getOptionsAlign, isLeaf, isModal, setButtonListener, setLeaf, setModal, setOptionsAlign
addPropertyChangeListener, createNotificationLineSupport, firePropertyChange, getAdditionalOptions, getDefaultValue, getMessage, getMessageType, getNotificationLineSupport, getOptions, getOptionType, getTitle, getTitleForType, isNoDefaultClose, isValid, removePropertyChangeListener, setMessage, setMessageType, setNoDefaultClose, setOptionType, setTitle, setValid
public static final Object NEXT_OPTION
public static final Object FINISH_OPTION
public static final Object PREVIOUS_OPTION
public static final String PROP_AUTO_WIZARD_STYLE
true
for enabling other properties. It is relevant only on
initialization (client property in first panel). Recommended to be set to true
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 from WizardDescriptor.getProperty()
or
((JComponent)Panel.getComponent()).getClientProperty()
in this order.
Boolean
type property.public static final String PROP_HELP_DISPLAYED
true
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 property PROP_HELP_URL
.
The value is taken from WizardDescriptor.getProperty()
or
((JComponent)Panel.getComponent()).getClientProperty()
in this order.
Boolean
type property.public static final String PROP_CONTENT_DISPLAYED
true
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 property PROP_CONTENT_DATA
.
The value is taken from WizardDescriptor.getProperty()
or
((JComponent)Panel.getComponent()).getClientProperty()
in this order.
Boolean
type property.public static final String PROP_CONTENT_NUMBERED
true
for displaying numbers in the content. It is relevant only on
initialization (client property in first panel).
The value is taken from WizardDescriptor.getProperty()
or
((JComponent)Panel.getComponent()).getClientProperty()
in this order.
Boolean
type property.public static final String PROP_CONTENT_SELECTED_INDEX
WizardDescriptor.getProperty()
or
((JComponent)Panel.getComponent()).getClientProperty()
in this order.
Integer
type property.public static final String PROP_CONTENT_DATA
WizardDescriptor.getProperty()
or
((JComponent)Panel.getComponent()).getClientProperty()
in this order.
String[]
type property.public static final String PROP_CONTENT_BACK_COLOR
WizardDescriptor.getProperty()
or
((JComponent)Panel.getComponent()).getClientProperty()
in this order.
Color
type property.public static final String PROP_CONTENT_FOREGROUND_COLOR
WizardDescriptor.getProperty()
or
((JComponent)Panel.getComponent()).getClientProperty()
in this order.
Color
type property.public static final String PROP_IMAGE
WizardDescriptor.getProperty()
or
((JComponent) Panel.getComponent()).getClientProperty()
in this order.
java.awt.Image
type property.public static final String PROP_IMAGE_ALIGNMENT
WizardDescriptor.getProperty()
or
((JComponent) Panel.getComponent()).getClientProperty()
in this order.
String
type property.public static final String PROP_LEFT_DIMENSION
PROP_IMAGE
.
It is relevant only on initialization (client property in first panel).
The value is taken from WizardDescriptor.getProperty()
or
((JComponent) Panel.getComponent()).getClientProperty()
in this order.
Dimension
type property.public static final String PROP_HELP_URL
WizardDescriptor.getProperty()
or
((JComponent) Panel.getComponent()).getClientProperty()
in this order.
URL
type property.public static final String PROP_ERROR_MESSAGE
WizardDescriptor.getProperty()
.
String
type property.public static final String PROP_WARNING_MESSAGE
WizardDescriptor.getProperty()
.
String
type property.public static final String PROP_INFO_MESSAGE
WizardDescriptor.getProperty()
.
String
type property.public WizardDescriptor(WizardDescriptor.Panel<Data>[] wizardPanels, Data settings)
wizardPanels
- the panels to usesettings
- the settings to pass to panels, or null
WizardDescriptor.WizardDescriptor(WizardDescriptor.Iterator, Object)
public WizardDescriptor(WizardDescriptor.Panel<WizardDescriptor>[] wizardPanels)
this
.wizardPanels
- the panels to useWizardDescriptor.WizardDescriptor(WizardDescriptor.Iterator, Object)
public WizardDescriptor(WizardDescriptor.Iterator<Data> panels, Data settings)
panels
- iterator over all WizardDescriptor.Panel
s that can appear in the wizardsettings
- the settings to provide to the panels (may be any data understood by them)WizardDescriptor.Panel.readSettings(Data)
,
WizardDescriptor.Panel.storeSettings(Data)
protected WizardDescriptor()
WizardDescriptor.setPanelsAndSettings(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.public WizardDescriptor(WizardDescriptor.Iterator<WizardDescriptor> panels)
this
.panels
- iterator over all WizardDescriptor.Panel
s that can appear in the wizardprotected void initialize()
initialize
in class NotifyDescriptor
@Deprecated public final void setPanels(WizardDescriptor.Iterator panels)
panels
- the new list of WizardDescriptor.Panel
spublic final <Data> void setPanelsAndSettings(WizardDescriptor.Iterator<Data> panels, Data settings)
panels
- the new list of WizardDescriptor.Panel
ssettings
- the new settings that will be passed to the panelspublic void setOptions(Object[] options)
DialogDescriptor
.
Substitutes tokens such as WizardDescriptor.NEXT_OPTION
with the actual button.setOptions
in class NotifyDescriptor
options
- the options to setNotifyDescriptor.getOptions()
public void setAdditionalOptions(Object[] options)
NotifyDescriptor
The usual value for the options parameter is an array of
String
s. But the parameter type is an array of Object
s. Its
interpretation depends on its type:
setAdditionalOptions
in class NotifyDescriptor
options
- the options to setNotifyDescriptor.getOptions()
public void setClosingOptions(Object[] options)
DialogDescriptor
setClosingOptions
in class DialogDescriptor
options
- the options to setpublic Object getValue()
getValue
in class NotifyDescriptor
Object
indicating the option selected by the userNotifyDescriptor.setValue(java.lang.Object)
public void setTitleFormat(MessageFormat format)
{0} wizard {1}That can be expanded to something like this
EJB wizard (1 of 8)This method allows anybody to provide own title format.
format
- message format to the titlepublic MessageFormat getTitleFormat()
WizardDescriptor.setTitleFormat(java.text.MessageFormat)
public void putProperty(String name, Object value)
name
- name of the propertyvalue
- value of propertypublic Object getProperty(String name)
name
- name of the propertypublic Map<String,Object> getProperties()
WizardDescriptor.putProperty(java.lang.String, java.lang.Object)
methodpublic void setHelpCtx(HelpCtx helpCtx)
DialogDescriptor
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
nor HelpCtx.DEFAULT_HELP
. If the
descriptor is null
, this feature will be disabled
(you can still add your own help button manually if you wish,
of course). If DEFAULT_HELP
(the default), normally the button
will also be disabled, however if the inner pane is a component
and this component has an associated
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 to null
you must explicitly call this method; passing
null
in the constructor actually sets it to DEFAULT_HELP
.
setHelpCtx
in class DialogDescriptor
helpCtx
- new help context, can be null
(no help)DialogDescriptor.getHelpCtx()
public Set getInstantiatedObjects()
IllegalStateException
- if this method is called on the unfinished wizardprotected void updateState()
super.updateState ();
setOptions (...);
public void setValue(Object value)
CLOSED_OPTION
.setValue
in class NotifyDescriptor
value
- the chosen valueNotifyDescriptor.getValue()
public final void doNextClick()
public final void doPreviousClick()
public final void doFinishClick()
public final void doCancelClick()