Class WizardDialog

All Implemented Interfaces:
ActionContextProvider, StatusListener, TaskListener

public class WizardDialog extends DialogComponentProvider
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 Details

  • Constructor Details

    • WizardDialog

      public WizardDialog(WizardModel<?> model)
      Constructs a modal WizardDialog using the given model.
      Parameters:
      model - the wizard model
    • WizardDialog

      public WizardDialog(WizardModel<?> model, boolean modal)
      Constructs a WizardDialog using the given model.
      Parameters:
      model - the wizard model
      modal - true if the wizard should be modal
  • Method Details

    • getStatusMessage

      public String getStatusMessage()
      Returns the current status message being displayed in this dialog.
      Returns:
      the current status message being displayed in this dialog
    • setStatusMessage

      public void setStatusMessage(String message)
      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

      public WizardStep<?> getCurrentStep()
      Returns the current wizard panel.
      Returns:
      the current wizard panel
    • show

      public void show()
      Shows the wizard dialog.
    • show

      public void show(Component parent)
      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 class DialogComponentProvider
    • 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 class DialogComponentProvider