Package docking.wizard
Class WizardDialog
java.lang.Object
docking.DialogComponentProvider
docking.wizard.WizardDialog
- All Implemented Interfaces:
ActionContextProvider
,StatusListener
,TaskListener
A dialog for displaying a series of wizard panels used to collect data from the user before
performing some task with the collected data. This dialog is generic and is used to display
the wizard steps as defined by a
WizardModel
.
To use this dialog, create an instance of a WizardModel
and construct this dialog
with that model, optionally specifying if the dialog is modal or not (default is modal). Then
call either the show()
or show(Component)
method to display it. If the model's
purpose is to create some object, get it from the model when done.
For example,
FooWizardModel model = new FooWizardModel(); WizardDialog wizard = new WizardDialog(model); wizard.show(); Foo foo = model.getFoo();
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Default text for the 'back' buttonstatic final String
Default text for the 'finish' buttonstatic final String
Default text for the 'next' buttonFields inherited from class docking.DialogComponentProvider
applyButton, buttonPanel, cancelButton, dismissButton, okButton, rootPanel
-
Constructor Summary
ConstructorsConstructorDescriptionWizardDialog
(WizardModel<?> model) Constructs a modal WizardDialog using the given model.WizardDialog
(WizardModel<?> model, boolean modal) Constructs a WizardDialog using the given model. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancels the wizardprotected void
The callback method for when the "Cancel" button is pressed.void
dispose()
Disposes this dialog.void
Places focus on the 'finish' button.void
Places focus on the 'next' button.WizardStep
<?> Returns the current wizard panel.Returns the current status message being displayed in this dialog.void
setStatusMessage
(String message) Sets the status message on the dialogvoid
show()
Shows the wizard dialog.void
Shows the wizard dialog parented to the given component.Methods inherited from class docking.DialogComponentProvider
addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, close, closeDialog, createSharedActions, dialogClosed, dialogShown, dismissCallback, doInitialize, escapeCallback, executeProgressTask, getActionContext, getActions, getBackground, getBounds, getComponent, getDefaultButton, getDefaultSize, getDialogSize, getFocusComponent, getGlassPane, getHelpLocation, getId, getInitialLocation, getLocationOnScreen, getParent, getPreferredSize, getRememberLocation, getRememberSize, getStatusColor, getStatusLabel, getStatusText, getTaskMonitorComponent, getTaskScheduler, getTitle, getUseSharedLocation, hideTaskMonitorComponent, isApplyEnabled, isCancelEnabled, isDialogKeyBindingAction, isModal, isOKEnabled, isResizeable, isRunningTask, isShowing, isTransient, isVisible, notifyContextChanged, okCallback, removeAction, removeButton, removeWorkPanel, repack, setAccessibleDescription, setApplyEnabled, setApplyToolTip, setBackground, setCancelButtonText, setCancelEnabled, setCancelToolTip, setCursor, setDefaultButton, setDefaultSize, setDialogSize, setDismissToolTip, setFocusComponent, setGlassPane, setHelpLocation, setInitialLocation, setMinimumSize, setMinimumSize, setOkButtonText, setOkEnabled, setOkToolTip, setPreferredSize, setRememberLocation, setRememberSize, setResizable, setStatusJustification, setStatusText, setStatusText, setStatusText, setTitle, setTransient, setUseSharedLocation, showProgressBar, showTaskMonitorComponent, stopProgressTimer, taskCancelled, taskCompleted, toFront, toString, waitForCurrentTask
-
Field Details
-
FINISH
Default text for the 'finish' button- See Also:
-
NEXT
Default text for the 'next' button- See Also:
-
BACK
Default text for the 'back' button- See Also:
-
-
Constructor Details
-
WizardDialog
Constructs a modal WizardDialog using the given model.- Parameters:
model
- the wizard model
-
WizardDialog
Constructs a WizardDialog using the given model.- Parameters:
model
- the wizard modelmodal
- true if the wizard should be modal
-
-
Method Details
-
getStatusMessage
Returns the current status message being displayed in this dialog.- Returns:
- the current status message being displayed in this dialog
-
setStatusMessage
Sets the status message on the dialog- Parameters:
message
- the message to display in the dialog
-
focusNext
public void focusNext()Places focus on the 'next' button. -
focusFinish
public void focusFinish()Places focus on the 'finish' button. -
getCurrentStep
Returns the current wizard panel.- Returns:
- the current wizard panel
-
show
public void show()Shows the wizard dialog. -
show
Shows the wizard dialog parented to the given component.- Parameters:
parent
- the component to parent the dialog to
-
dispose
public void dispose()Description copied from class:DialogComponentProvider
Disposes this dialog. Only call this when the dialog is no longer used. Calling this method will close the dialog if it is open.- Overrides:
dispose
in classDialogComponentProvider
-
cancel
public void cancel()Cancels the wizard -
cancelCallback
protected void cancelCallback()Description copied from class:DialogComponentProvider
The callback method for when the "Cancel" button is pressed. The default behavior is to call setVisible(false) and dispose() on the dialog.- Overrides:
cancelCallback
in classDialogComponentProvider
-