|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
info.aduna.swing.wizard.Wizard
public class Wizard
Wizard is a utility class that offers functionality for defining graphical Wizards.
The panels in a Wizard are instances of WizardSheet. The Wizard is presented with the first WizardSheet, subsequent WizardSheets are retrieved from this WizardSheet. All WizardSheets are immediately put in a JPanel with a CardLayout, so that it does not need to resize when switching WizardSheets.
A Wizard offers four buttons that allow the user to select the previous or next WizardSheet or to cancel or finish the Wizard. Objects can register themselves as WizardListener on a Wizard. They are then notified when the action behind any of these buttons has finished. Alternatively, an object can also register itself directly as ActionListener on any of these buttons, if it is not required that it is triggered after the Wizard's underlying action has finished.
WizardSheet,
WizardListener,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
Wizard()
Create a new Wizard with initially no WizardSheets. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
Dispatches the ActionEvents from the Back, Next, Cancel en Finish buttons to the _back, _next, _cancel en _finish methods and updates the button's states. |
void |
addWizardListener(WizardListener listener)
Add a WizardListener to the list of WizardListeners. |
JButton |
getBackButton()
|
JButton |
getCancelButton()
|
WizardSheet |
getCurrentSheet()
|
JButton |
getNextButton()
|
WizardSheet |
getStartSheet()
|
void |
removeWizardListener(WizardListener listener)
Remove a WizardListener from the list of WizardListeners. |
void |
resetToStartSheet()
Updates the wizard so that the start sheet is the current WizardSheet again. |
void |
setStartSheet(WizardSheet startSheet)
Set the WizardSheet this Wizard should start with. |
void |
show(WizardSheet sheet,
boolean initializeSheet)
Makes the specified WizardSheet the current sheet. |
void |
stateChanged(WizardSheet sheet)
Updates the state of the buttons in this Wizard if the event originates from the current WizardSheet. |
protected void |
updateButtonState(boolean updateFocus)
Sets the enabled property of the buttons so that it corresponds with the state of the current WizardSheet. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Wizard()
| Method Detail |
|---|
public void setStartSheet(WizardSheet startSheet)
public void resetToStartSheet()
It is advisable to invoke this method when a Wizard is kept in memory for subsequent uses, to prevent memory leaks (since all sheets are cleared by this method).
This invocation is only valid when the start sheet has been set already.
public WizardSheet getStartSheet()
public WizardSheet getCurrentSheet()
public JButton getBackButton()
public JButton getNextButton()
public JButton getCancelButton()
public void show(WizardSheet sheet,
boolean initializeSheet)
protected void updateButtonState(boolean updateFocus)
public void stateChanged(WizardSheet sheet)
stateChanged in interface WizardSheetListenerpublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic void addWizardListener(WizardListener listener)
public void removeWizardListener(WizardListener listener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||