|
||||||||||
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
org.pietschy.wizard.Wizard
The wizard class is the main entry point for creating wizards. Typically you will create
the wizard with your own WizardModel
implementation and then call showInFrame(java.lang.String)
or one of the releated methods.
In the simplest case, you would subclass StaticModel
and add a number
of WizardStep
instances.
StaticModel model = new StaticModel(); model.add(new MyFirestStep()); model.add(...); ... Wizard wizard = new Wizard(model); wizard.showInFrame("My Wizard");
StaticModel
,
DynamicModel
,
MultiPathModel
,
Serialized FormNested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected static int |
BORDER_WIDTH
|
static int |
EXIT_ON_CLOSE
When specified as the defaultExitMode , this
causes the wizard to continue displaying the final step after finished has been pressed. |
static int |
EXIT_ON_FINISH
When specified as the defaultExitMode , this
causes the wizard to exit immediately once finish is pressed and
WizardStep.applyState() has been invoked. |
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(WizardModel model)
Creates a new Wizard that uses the specified WizardModel . |
Method Summary | |
void |
addWizardListener(WizardListener l)
Adds a WizardListener to this wizard. |
void |
cancel()
Cancels this wizard. |
void |
close()
Closes this wizard. |
protected boolean |
confirmAbort()
This method is called when the user cancels the wizard while the #activeStep is
busy . |
protected ButtonBar |
createButtonBar()
Called by the constructor to create the button bar. |
protected javax.swing.JComponent |
createTitleComponent()
Called by the constructor to create the wizards title component. |
javax.swing.Action |
getCancelAction()
Returns the action that is bound to the cancel button. |
javax.swing.Action |
getCloseAction()
Returns the action that is bound to the close button. |
int |
getDefaultExitMode()
Gets the exit mode of the wizard, being either EXIT_ON_FINISH or
EXIT_ON_CLOSE |
javax.swing.Action |
getFinishAction()
Returns the action that is bound to the showCloseButton button. |
javax.swing.Action |
getHelpAction()
Returns the action that is bound to the close button. |
HelpBroker |
getHelpBroker()
|
javax.swing.Action |
getLastAction()
Returns the action that is bound to the last button. |
WizardModel |
getModel()
Gets the models this wizard is using. |
javax.swing.Action |
getNextAction()
Returns the action that is bound to the next button. |
javax.swing.Action |
getPreviousAction()
Returns the action that is bound to the previous button. |
javax.swing.JComponent |
getTitleComponent()
Gets the component being used to render the wizards title. |
boolean |
isOverviewVisible()
Checks the visibily of the overview panel that is displayed on the wizards left panel. |
void |
removeWizardListener(WizardListener l)
Removes a WizardListener from this wizard. |
void |
reset()
Resets the wizard. |
void |
setDefaultExitMode(int defaultExitMode)
Set the time when the wizard exits. |
void |
setHelpBroker(HelpBroker broker)
|
void |
setOverviewVisible(boolean overviewVisible)
Configures the visibily of the overview panel that is displayed on the wizards left panel. |
protected void |
showCloseButton()
Marks this wizard as finished. |
void |
showInDialog(java.lang.String title,
java.awt.Component parent,
boolean modal)
Displays the wizard in a new JDialog with the specified title. |
void |
showInFrame(java.lang.String title)
Displays the wizard in a new JFrame with the specified title. |
void |
showInFrame(java.lang.String title,
java.awt.Component relativeTo)
Displays the wizard in a new JFrame with the specified title. |
void |
showInFrame(java.lang.String title,
java.awt.Image windowIcon)
Displays the wizard in a new JFrame with the specified title. |
void |
showInFrame(java.lang.String title,
java.awt.Image windowIcon,
java.awt.Component relativeTo)
Displays the wizard in a new JFrame with the specified title. |
boolean |
wasCanceled()
Checks if the wizard was canceled. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final int BORDER_WIDTH
public static final int EXIT_ON_CLOSE
defaultExitMode
, this
causes the wizard to continue displaying the final step after finished has been pressed. The
wizard is closed when the user presses the close button. This allows the wizard to display a
final confirmation screen.
EXIT_ON_FINISH
,
Constant Field Valuespublic static final int EXIT_ON_FINISH
defaultExitMode
, this
causes the wizard to exit immediately once finish is pressed and
WizardStep.applyState()
has been invoked.
EXIT_ON_CLOSE
,
Constant Field ValuesConstructor Detail |
public Wizard(WizardModel model)
WizardModel
.
model
- the model that the wizard is to use.Method Detail |
public void setDefaultExitMode(int defaultExitMode)
EXIT_ON_FINISH
and EXIT_ON_CLOSE
.
The default value is EXIT_ON_CLOSE
defaultExitMode
- the default exit mode.public int getDefaultExitMode()
EXIT_ON_FINISH
or
EXIT_ON_CLOSE
protected javax.swing.JComponent createTitleComponent()
DefaultTitleComponent
but subclasses may override to provide a custom implementation. Typically the
title component listens to the wizard model and updates its appearance accordingly.
getTitleComponent()
public javax.swing.JComponent getTitleComponent()
DefaultTitleComponent
. Subclasses can change the default by overriding createTitleComponent()
.
For example, to activate the gradient background on the default title component you can call.
((DefaultTitleComponent) wizard.getTitleComponent()).setGradientBackground(true);
protected ButtonBar createButtonBar()
ButtonBar
implementation.
ButtonBar
.public void reset()
WizardModel.reset()
.
public WizardModel getModel()
public boolean isOverviewVisible()
WizardModel
implements OverviewProvider
.
public void setOverviewVisible(boolean overviewVisible)
WizardModel
implements
OverviewProvider
.
overviewVisible
- true to display the overview, false otherwise.public void setHelpBroker(HelpBroker broker)
public HelpBroker getHelpBroker()
public javax.swing.Action getNextAction()
public javax.swing.Action getPreviousAction()
public javax.swing.Action getLastAction()
public javax.swing.Action getFinishAction()
public javax.swing.Action getCancelAction()
public javax.swing.Action getHelpAction()
public javax.swing.Action getCloseAction()
protected void showCloseButton()
public void cancel()
WizardListener.wizardCancelled(org.pietschy.wizard.WizardEvent)
event.
public boolean wasCanceled()
protected boolean confirmAbort()
#activeStep
is
busy
. This method displays a JOptionPane
asking if the
user wants to abort the wizard.
public void close()
WizardListener.wizardClosed(org.pietschy.wizard.WizardEvent)
event.
public void addWizardListener(WizardListener l)
WizardListener
to this wizard.
l
- the listener to add.public void removeWizardListener(WizardListener l)
WizardListener
from this wizard.
l
- the listener to remove.public void showInFrame(java.lang.String title)
JFrame
with the specified title. The frame will
be automatically closed when the wizard is completed or canceled. This method will
not block.
title
- the title of the frame.addWizardListener(org.pietschy.wizard.WizardListener)
,
removeWizardListener(org.pietschy.wizard.WizardListener)
public void showInFrame(java.lang.String title, java.awt.Image windowIcon)
JFrame
with the specified title. The frame will
be automatically closed when the wizard is completed or canceled. This method will
not block.
title
- the title of the frame.windowIcon
- the icon to use for the frame. This is used to configure Frame.setIconImage(java.awt.Image)
.addWizardListener(org.pietschy.wizard.WizardListener)
,
removeWizardListener(org.pietschy.wizard.WizardListener)
public void showInFrame(java.lang.String title, java.awt.Component relativeTo)
JFrame
with the specified title. The frame will
be automatically closed when the wizard is completed or canceled. This method will
not block.
title
- the title of the frame.relativeTo
- the new JFrame
will be displayed relative to this component. If
the component is null, the window will be centered on the
desktop as per Window.setLocationRelativeTo(java.awt.Component)
.addWizardListener(org.pietschy.wizard.WizardListener)
,
removeWizardListener(org.pietschy.wizard.WizardListener)
public void showInFrame(java.lang.String title, java.awt.Image windowIcon, java.awt.Component relativeTo)
JFrame
with the specified title. The frame will
be automatically closed when the wizard is completed or canceled. This method will
not block.
title
- the title of the frame.windowIcon
- the icon to use for the frame. This is used to configure Frame.setIconImage(java.awt.Image)
.relativeTo
- the new JFrame
will be displayed relative to this component. If
the component is null, the window will be centered on the
desktop as per Window.setLocationRelativeTo(java.awt.Component)
.addWizardListener(org.pietschy.wizard.WizardListener)
,
removeWizardListener(org.pietschy.wizard.WizardListener)
public void showInDialog(java.lang.String title, java.awt.Component parent, boolean modal)
JDialog
with the specified title. The dialog will
be automatically closed when the wizard is completed or canceled. This method will
block if the dialog is modal.
title
- the dialog title.parent
- the component that will own the dialog.modal
- true to make the dialog modal, false otherwise.addWizardListener(org.pietschy.wizard.WizardListener)
,
removeWizardListener(org.pietschy.wizard.WizardListener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |