Interface WizardDescriptor.Panel<Data>

All Known Subinterfaces:
WizardDescriptor.AsynchronousValidatingPanel<Data>, WizardDescriptor.ExtendedAsynchronousValidatingPanel<Data>, WizardDescriptor.FinishablePanel<Data>, WizardDescriptor.FinishPanel<Data>, WizardDescriptor.ValidatingPanel<Data>
Enclosing class:
WizardDescriptor

public static interface WizardDescriptor.Panel<Data>
One wizard panel with a component on it. For good performance, implementation of this interface should be as lightweight as possible. Defer creation and initialization of UI component of wizard panel into getComponent() method. Please see complete guide at http://performance.netbeans.org/howto/dialogs/wizard-panels.html
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add a listener to changes of the panel's validity.
    Get the component displayed in this panel.
    org.openide.util.HelpCtx
    Help for this panel.
    boolean
    Test whether the panel is finished and it is safe to proceed to the next one.
    void
    readSettings(Data settings)
    Provides the wizard panel with the current data--either the default data or already-modified settings, if the user used the previous and/or next buttons.
    void
    Remove a listener to changes of the panel's validity.
    void
    storeSettings(Data settings)
    Provides the wizard panel with the opportunity to update the settings with its current customized state.
  • Method Details

    • getComponent

      Component getComponent()
      Get the component displayed in this panel. Note; method can be called from any thread, but not concurrently with other methods of this interface. Please see complete guide at http://performance.netbeans.org/howto/dialogs/wizard-panels.html for correct implementation.
      Returns:
      the UI component of this wizard panel
    • getHelp

      org.openide.util.HelpCtx getHelp()
      Help for this panel. When the panel is active, this is used as the help for the wizard dialog.
      Returns:
      the help or null if no help is supplied
    • readSettings

      void readSettings(Data settings)
      Provides the wizard panel with the current data--either the default data or already-modified settings, if the user used the previous and/or next buttons. This method can be called multiple times on one instance of WizardDescriptor.Panel.

      The settings object is originally supplied to WizardDescriptor(WizardDescriptor.Iterator,Object). In the case of a TemplateWizard.Iterator panel, the object is in fact the TemplateWizard.

      Parameters:
      settings - the object representing wizard panel state
      Throws:
      IllegalStateException - if the the data provided by the wizard are not valid.
    • storeSettings

      void storeSettings(Data settings)
      Provides the wizard panel with the opportunity to update the settings with its current customized state. Rather than updating its settings with every change in the GUI, it should collect them, and then only save them when requested to by this method. Also, the original settings passed to readSettings(Data) should not be modified (mutated); rather, the object passed in here should be mutated according to the collected changes, in case it is a copy. This method can be called multiple times on one instance of WizardDescriptor.Panel.

      The settings object is originally supplied to WizardDescriptor(WizardDescriptor.Iterator,Object). In the case of a TemplateWizard.Iterator panel, the object is in fact the TemplateWizard.

      Parameters:
      settings - the object representing wizard panel state
    • isValid

      boolean isValid()
      Test whether the panel is finished and it is safe to proceed to the next one. If the panel is valid, the "Next" (or "Finish") button will be enabled.

      Tip: if your panel is actually the component itself (so getComponent() returns this), be sure to specifically override this method, as the unrelated implementation in Component.isValid() if not overridden could cause your wizard to behave erratically.

      Returns:
      true if the user has entered satisfactory information
    • addChangeListener

      void addChangeListener(ChangeListener l)
      Add a listener to changes of the panel's validity.
      Parameters:
      l - the listener to add
      See Also:
    • removeChangeListener

      void removeChangeListener(ChangeListener l)
      Remove a listener to changes of the panel's validity.
      Parameters:
      l - the listener to remove