All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IWizard, IWizardModelListener, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IQueueRegion, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class Wizard extends Panel implements IWizardModelListener, IWizard
A wizard is a dialog component that takes users through a number of steps to complete a task. It has common functionality like a next, previous, finish and cancel button, and it uses a IWizardModel to navigate through the steps.

Before you can use the wizard component, it needs to be initialized with a model. You do this by calling init(IWizardModel) with the wizard model you intent to use.

This default implementation should be useful for basic cases, if the layout is exactly what you need. If you want to provide your own layout and/ or have more or less components (e.g. you want to additionally provide an overview component), you can override this class and add the components you want yourself using methods like newButtonBar(String) et-cetera.

Author:
Eelco Hillenius
See Also:
  • Field Details

  • Constructor Details

    • Wizard

      public Wizard(String id)
      Construct. Adds the default style.

      If you override this class, it makes sense to call this constructor (super(id)), then - in your constructor - construct a transition model and then call init(IWizardModel) to initialize the wizard.

      This constructor is not meant for normal clients of this class

      Parameters:
      id - The component model
    • Wizard

      public Wizard(String id, IWizardModel wizardModel)
      Construct with a transition model. Adds the default style.

      For most clients, this is typically the right constructor to use.

      Parameters:
      id - The component id
      wizardModel - The transitions model
  • Method Details

    • getActiveStep

      public final IWizardStep getActiveStep()
      Convenience method to get the active step from the model.
      Returns:
      The active step
    • getForm

      public Form<?> getForm()
      Gets the form in which the view is nested, and on which the wizard buttons work.
      Returns:
      The wizard form
    • getWizardModel

      public final IWizardModel getWizardModel()
      Description copied from interface: IWizard
      Gets the model this wizard is using. This should never be null; a wizard is supposed to have a model.
      Specified by:
      getWizardModel in interface IWizard
      Returns:
      The wizard model.
      See Also:
    • isVersioned

      public boolean isVersioned()
      Turn versioning off for wizards. This works best when the wizard is not accessed from bookmarkable pages, so that the url doesn't change at all.
      Overrides:
      isVersioned in class Component
      Returns:
      False
      See Also:
    • onActiveStepChanged

      public void onActiveStepChanged(IWizardStep newStep)
      Description copied from interface: IWizardModelListener
      Called when the active step of this model changed.
      Specified by:
      onActiveStepChanged in interface IWizardModelListener
      Parameters:
      newStep - The new step
      See Also:
    • onCancel

      public void onCancel()
      Called when the wizard is canceled.
      Specified by:
      onCancel in interface IWizardModelListener
    • onFinish

      public void onFinish()
      Called when the wizard is finished.
      Specified by:
      onFinish in interface IWizardModelListener
    • init

      protected void init(IWizardModel wizardModel)
      Initialize this wizard with a transition model.

      If you constructed this wizard using a constructor without the transitions model argument, you must call this method prior to actually using it.

      Parameters:
      wizardModel -
    • newButtonBar

      protected Component newButtonBar(String id)
      Create a new button bar. Clients can override this method to provide a custom button bar.
      Parameters:
      id - The id to be used to construct the component
      Returns:
      A new button bar
    • newFeedbackPanel

      Create a new feedback panel. Clients can override this method to provide a custom feedback panel.
      Parameters:
      id - The id to be used to construct the component
      Returns:
      A new feedback panel
    • newForm

      protected <E> Form<E> newForm(String id)
      Create a new form. Clients can override this method to provide a custom Form.
      Type Parameters:
      E - The form's model object type
      Parameters:
      id - The id to be used to construct the component
      Returns:
      a new form
    • newOverviewBar

      Create a new overview bar. Clients can override this method to provide a custom bar.
      Parameters:
      id - The id to be used to construct the component
      Returns:
      A new overview bar