net.sf.fmj.ui.wizard
Class WizardPanelDescriptor

java.lang.Object
  extended by net.sf.fmj.ui.wizard.WizardPanelDescriptor
Direct Known Subclasses:
ChooseSourcePanelDescriptor, ContentAndTrackFormatPanelDescriptor, FileDestPanelDescriptor, RTPDestPanelDescriptor

public class WizardPanelDescriptor
extends java.lang.Object

Adapted Robert Eckstein's sample at http://java.sun.com/developer/technicalArticles/GUI/swing/wizard/ A base descriptor class used to reference a Component panel for the Wizard, as well as provide general rules as to how the panel should behave.


Field Summary
static net.sf.fmj.ui.wizard.WizardPanelDescriptor.FinishIdentifier FINISH
          Identifier returned by getNextPanelDescriptor() to indicate that this is the last panel and the text of the 'Next' button should change to 'Finish'.
 
Constructor Summary
WizardPanelDescriptor()
          Default constructor.
WizardPanelDescriptor(java.lang.Object id, java.awt.Component panel)
          Constructor which accepts both the Object-based identifier and a reference to the Component class which makes up the panel.
 
Method Summary
 boolean aboutToDisplayPanel(java.lang.Object prevId)
          Override this method to provide functionality that will be performed just before the panel is to be displayed.
 boolean aboutToHidePanel(java.lang.Object idOfNext)
          Override this method to perform functionality just before the panel is to be hidden.
 void displayingPanel()
          Override this method to perform functionality when the panel itself is displayed.
 java.lang.Object getBackPanelDescriptor()
          Override this class to provide the Object-based identifier of the panel that the user should traverse to when the Back button is pressed.
 java.lang.Object getNextPanelDescriptor()
          Override this class to provide the Object-based identifier of the panel that the user should traverse to when the Next button is pressed.
 java.awt.Component getPanelComponent()
          Returns to java.awt.Component that serves as the actual panel.
 java.lang.Object getPanelDescriptorIdentifier()
          Returns the unique Object-based identifier for this panel descriptor.
 Wizard getWizard()
          Returns a reference to the Wizard component.
 WizardModel getWizardModel()
          Returns a reference to the current WizardModel for this Wizard component.
 void setPanelComponent(java.awt.Component panel)
          Sets the panel's component as a class that extends java.awt.Component
 void setPanelDescriptorIdentifier(java.lang.Object id)
          Sets the Object-based identifier for this panel.
 void showError(java.lang.String e)
           
 void showError(java.lang.Throwable e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FINISH

public static final net.sf.fmj.ui.wizard.WizardPanelDescriptor.FinishIdentifier FINISH
Identifier returned by getNextPanelDescriptor() to indicate that this is the last panel and the text of the 'Next' button should change to 'Finish'.

Constructor Detail

WizardPanelDescriptor

public WizardPanelDescriptor()
Default constructor. The id and the Component panel must be set separately.


WizardPanelDescriptor

public WizardPanelDescriptor(java.lang.Object id,
                             java.awt.Component panel)
Constructor which accepts both the Object-based identifier and a reference to the Component class which makes up the panel.

Parameters:
id - Object-based identifier
panel - A class which extends java.awt.Component that will be inserted as a panel into the wizard dialog.
Method Detail

getPanelComponent

public final java.awt.Component getPanelComponent()
Returns to java.awt.Component that serves as the actual panel.

Returns:
A reference to the java.awt.Component that serves as the panel

setPanelComponent

public final void setPanelComponent(java.awt.Component panel)
Sets the panel's component as a class that extends java.awt.Component

Parameters:
panel - java.awt.Component which serves as the wizard panel

getPanelDescriptorIdentifier

public final java.lang.Object getPanelDescriptorIdentifier()
Returns the unique Object-based identifier for this panel descriptor.

Returns:
The Object-based identifier

setPanelDescriptorIdentifier

public final void setPanelDescriptorIdentifier(java.lang.Object id)
Sets the Object-based identifier for this panel. The identifier must be unique from all the other identifiers in the panel.

Parameters:
id - Object-based identifier for this panel.

getWizard

public final Wizard getWizard()
Returns a reference to the Wizard component.

Returns:
The Wizard class hosting this descriptor.

getWizardModel

public WizardModel getWizardModel()
Returns a reference to the current WizardModel for this Wizard component.

Returns:
The current WizardModel for this Wizard component.

getNextPanelDescriptor

public java.lang.Object getNextPanelDescriptor()
Override this class to provide the Object-based identifier of the panel that the user should traverse to when the Next button is pressed. Note that this method is only called when the button is actually pressed, so that the panel can change the next panel's identifier dynamically at runtime if necessary. Return null if the button should be disabled. Return FinishIdentfier if the button text should change to 'Finish' and the dialog should end.

Returns:
Object-based identifier.

getBackPanelDescriptor

public java.lang.Object getBackPanelDescriptor()
Override this class to provide the Object-based identifier of the panel that the user should traverse to when the Back button is pressed. Note that this method is only called when the button is actually pressed, so that the panel can change the previous panel's identifier dynamically at runtime if necessary. Return null if the button should be disabled.

Returns:
Object-based identifier

aboutToDisplayPanel

public boolean aboutToDisplayPanel(java.lang.Object prevId)
Override this method to provide functionality that will be performed just before the panel is to be displayed.


displayingPanel

public void displayingPanel()
Override this method to perform functionality when the panel itself is displayed.


aboutToHidePanel

public boolean aboutToHidePanel(java.lang.Object idOfNext)
Override this method to perform functionality just before the panel is to be hidden.


showError

public void showError(java.lang.Throwable e)

showError

public void showError(java.lang.String e)