|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.event.WindowAdapter
net.sf.fmj.ui.wizard.Wizard
public class Wizard
Adapted Robert Eckstein's sample at http://java.sun.com/developer/technicalArticles/GUI/swing/wizard/ This class implements a basic wizard dialog, where the programmer can insert one or more Components to act as panels. These panels can be navigated through arbitrarily using the 'Next' or 'Back' buttons, or the dialog itself can be closed using the 'Cancel' button. Note that even though the dialog uses a CardLayout manager, the order of the panels is not linear. Each panel determines at runtime what its next and previous panel will be.
Field Summary | |
---|---|
static java.lang.String |
BACK_BUTTON_ACTION_COMMAND
The String-based action command for the 'Back' button. |
static java.lang.String |
CANCEL_BUTTON_ACTION_COMMAND
The String-based action command for the 'Cancel' button. |
static int |
CANCEL_RETURN_CODE
Indicates that the 'Cancel' button was pressed to close the dialog, or the user pressed the close box in the corner of the window. |
static int |
ERROR_RETURN_CODE
Indicates that the dialog closed due to an internal error. |
static int |
FINISH_RETURN_CODE
Indicates that the 'Finish' button was pressed to close the dialog. |
static java.lang.String |
NEXT_BUTTON_ACTION_COMMAND
The String-based action command for the 'Next' button. |
Constructor Summary | |
---|---|
Wizard(java.awt.Dialog owner)
This method accepts a java.awt.Dialog object as the javax.swing.JDialog's parent. |
|
Wizard(java.awt.Frame owner)
This method accepts a java.awt.Frame object as the javax.swing.JDialog's parent. |
Method Summary | |
---|---|
boolean |
getBackButtonEnabled()
Mirrors the WizardModel method of the same name. |
boolean |
getCancelButtonEnabled()
Mirrors the WizardModel method of the same name. |
javax.swing.JDialog |
getDialog()
Returns an instance of the JDialog that this class created. |
WizardModel |
getModel()
Returns the current model of the wizard dialog. |
boolean |
getNextFinishButtonEnabled()
Mirrors the WizardModel method of the same name. |
java.awt.Component |
getOwner()
Returns the owner of the generated javax.swing.JDialog. |
int |
getReturnCode()
Retrieves the last return code set by the dialog. |
java.lang.String |
getTitle()
Returns the current title of the generated dialog. |
boolean |
isModal()
Returns the modality of the dialog. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Method used to listen for property change events from the model and update the dialog's graphical components as necessary. |
void |
registerWizardPanel(java.lang.Object id,
WizardPanelDescriptor panel)
Add a Component as a panel for the wizard dialog by registering its WizardPanelDescriptor object. |
void |
setBackButtonEnabled(boolean newValue)
Mirrors the WizardModel method of the same name. |
void |
setCancelButtonEnabled(boolean newValue)
Mirrors the WizardModel method of the same name. |
void |
setCurrentPanel(java.lang.Object id)
Displays the panel identified by the object passed in. |
void |
setModal(boolean b)
Sets the modality of the generated javax.swing.JDialog. |
void |
setNextFinishButtonEnabled(boolean newValue)
Mirrors the WizardModel method of the same name. |
void |
setTitle(java.lang.String s)
Sets the title of the generated javax.swing.JDialog. |
int |
showModalDialog()
Convienence method that displays a modal wizard dialog and blocks until the dialog has completed. |
void |
windowClosing(java.awt.event.WindowEvent e)
If the user presses the close box on the dialog's window, treat it as a cancel. |
Methods inherited from class java.awt.event.WindowAdapter |
---|
windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FINISH_RETURN_CODE
public static final int CANCEL_RETURN_CODE
public static final int ERROR_RETURN_CODE
public static final java.lang.String NEXT_BUTTON_ACTION_COMMAND
public static final java.lang.String BACK_BUTTON_ACTION_COMMAND
public static final java.lang.String CANCEL_BUTTON_ACTION_COMMAND
Constructor Detail |
---|
public Wizard(java.awt.Dialog owner)
owner
- The java.awt.Dialog object that is the owner of this dialog.public Wizard(java.awt.Frame owner)
owner
- The java.awt.Frame object that is the owner of the javax.swing.JDialog.Method Detail |
---|
public javax.swing.JDialog getDialog()
public java.awt.Component getOwner()
public void setTitle(java.lang.String s)
s
- The title of the dialog.public java.lang.String getTitle()
public void setModal(boolean b)
b
- the modality of the dialogpublic boolean isModal()
public int showModalDialog()
public WizardModel getModel()
public void registerWizardPanel(java.lang.Object id, WizardPanelDescriptor panel)
id
- An Object-based identifier used to identify the WizardPanelDescriptor object.panel
- The WizardPanelDescriptor object which contains helpful information about the panel.public void setCurrentPanel(java.lang.Object id)
id
- The Object-based identifier of the panel to be displayed.public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
evt
- PropertyChangeEvent passed from the model to signal that one of its properties has changed value.public int getReturnCode()
public boolean getBackButtonEnabled()
public void setBackButtonEnabled(boolean newValue)
newValue
- The new enabled status of the button.public boolean getNextFinishButtonEnabled()
public void setNextFinishButtonEnabled(boolean newValue)
newValue
- The new enabled status of the button.public boolean getCancelButtonEnabled()
public void setCancelButtonEnabled(boolean newValue)
newValue
- The new enabled status of the button.public void windowClosing(java.awt.event.WindowEvent e)
windowClosing
in interface java.awt.event.WindowListener
windowClosing
in class java.awt.event.WindowAdapter
e
- The event passed in from AWT.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |