org.openide
Interface WizardDescriptor.Panel

All Known Subinterfaces:
WizardDescriptor.FinishPanel
Enclosing class:
WizardDescriptor

public static interface WizardDescriptor.Panel

One wizard panel with a component on it.


Method Summary
 void addChangeListener(ChangeListener l)
          Add a listener to changes of the panel's validity.
 Component getComponent()
          Get the component displayed in this panel.
 HelpCtx getHelp()
          Help for this panel.
 boolean isValid()
          Test whether the panel is finished and it is safe to proceed to the next one.
 void readSettings(Object 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 removeChangeListener(ChangeListener l)
          Remove a listener to changes of the panel's validity.
 void storeSettings(Object settings)
          Provides the wizard panel with the opportunity to update the settings with its current customized state.
 

Method Detail

getComponent

public Component getComponent()
Get the component displayed in this panel.
Returns:
the component

getHelp

public 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

public void readSettings(Object 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.
Parameters:
settings - the object representing wizard panel state, as originally supplied to WizardDescriptor.WizardDescriptor(WizardDescriptor.Iterator,Object)
Throws:
IllegalStateException - if the the data provided by the wizard are not valid.

storeSettings

public void storeSettings(Object 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(java.lang.Object) should not be modified (mutated); rather, the (copy) passed in here should be mutated according to the collected changes. This method can be called multiple times on one instance of WizardDescriptor.Panel.
Parameters:
settings - the object representing a settings of the wizard

isValid

public 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

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

removeChangeListener

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


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.