Side of Software
Wizard Library 1.6

sos.wizard
Class JWizard

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--sos.wizard.JWizard
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class JWizard
extends javax.swing.JComponent
implements javax.accessibility.Accessible

A visual component that takes the user through a sequence of pages.

It is comprised of a page panel, an accessory panel, and a button panel. The page panel gathers user input needed to carry out a task. The (optional) accessory panel can be any component or a default list of steps. The (optional) button panel contains a mix of the navigation buttons (Next, Back, and Last) and the action buttons (Finish, Cancel, Help, and Close).

Since the wizard is typically used in a standalone, modal dialog, clients can invoke the convenience method showDialog. This method blocks until the dialog has been dismissed.

A JWizard component relies on an underlying, non-null wizard model to determine what pages, steps, and buttons to inclue. The methods that deal with the model are:

   JWizard( WizardModel model );
   JWizard( WizardModel model, JComponent accessory );
   WizardModel getModel();
   void setModel( WizardModel );

Side Panel

The side panel is accessed with the methods

   JComponent getAccessory();
   void setAccessory( JComponent accessory );
If the accessory is null, then the value of the default accessory property determines the side panel. If the value is DEFAULT_ACCESSORY_NONE, then no side panel is used; if the value is DEFAULT_ACCESSORY_STEPS, then a list of steps is used. The methods that deal with the default accessory are

   int getDefaultAccessory();
   void setDefaultAccessory( int defaultAccessory );

Page Panel

The pages that appear in the page panel come from the wizard model's getCurrentPage method. The pages are rendered and edited using a page editor. For a given page, the wizard component determines which editor to use in the getPageEditor(Page) method. Although subclasses may change the behavior, JWizard's implementation chooses the editor registered with the first class along the page's class heirarchy (similar to javax.swing.JTable's default look-up mechanism). The methods that register and retrieve page editors are:

   PageEditor getDefaultPageEditor( Page );
   void setDefaultPageEditor( Page page, PageEditor pageEditor );

Button Panel

The buttons included on the wizard depend on the installed UI and the underlying model. JWizard, however, can influence the decision with the following methods:

   boolean getHelpButtonIsShown();
   void setHelpButtonIsShown( boolean shown );
   boolean getControlButtonsAreShown();
   void setControlButtonsAreShown( boolean shown );
If all of the buttons are hidden-- via setControlButtonsAreShown(false)-- then it is the programmer's responsibility to control the wizard by invoking the following methods, as needed:

   boolean doNext();
   void doBack();
   boolean doLast();
   boolean doFinish();
   void doCancel();
   void doClose();
   void doHelp();
Each of the above methods sends a corresponding java.awt.event.ActionEvent. To respond to these actions, register an action listener. For example, the following code responds to the Help action:

   wizard.addActionListener( new ActionListener() {
     public void actionPerformed( ActionEvent event )
     {
       String command = event.getActionCommand();

       if( JWizard.HELP_ACTION.equals( command ))
         JOptionPane.showMessageDialog( wizard,
           "The programmer is responsible for responding to the " +
           "Help button." );
      }
   } );

For more information on how to use and customize a JWizard, see Side of Software's online tutorial.

Since:
1.0
See Also:
WizardModel, Page, PageEditor

Nested Class Summary
protected  class JWizard.AccessibleJWizard
          A class that implements accessibility support for a JWizard.
 
Field Summary
static java.lang.String ACCESSORY_COMPONENT_PROPERTY
          Constant used by property change events to signal that a JWizard's accessory component has changed.
static java.lang.String BACK_ACTION
          Instruction to return to the previous step.
static java.lang.String CANCEL_ACTION
          Instruction to cancel the wizard.
static java.lang.String CLOSE_ACTION
          Instruction to close the finished wizard.
static java.lang.String CONTROL_BUTTONS_ARE_SHOWN_PROPERTY
          Constant used by property change events to signal that a JWizard's desire to display the controls buttons has changed.
static int DEFAULT_ACCESSORY_NONE
          Constant that signals not to use a default accessory component.
static java.lang.String DEFAULT_ACCESSORY_PROPERTY
          Constant used by property change events to signal that a JWizard's default accessory preference has changed.
static int DEFAULT_ACCESSORY_STEPS
          Constant that signals to use a list of steps as the default accessory component.
static java.lang.String FINISH_ACTION
          Instruction to finish the wizard.
static java.lang.String FINISH_BUTTON_MNEMONIC_PROPERTY
          Constant used by property change events to signal that a JWizard's Finish button mnemonic has changed.
static java.lang.String FINISH_BUTTON_TEXT_PROPERTY
          Constant used by property change events to signal that a JWizard's Finish button text has changed.
static java.lang.String FINISH_BUTTON_TOOL_TIP_TEXT_PROPERTY
          Constant used by property change events to signal that a JWizard's Finish button tooltip text has changed.
static java.lang.String HELP_ACTION
          Instruction to provide additional help.
static java.lang.String HELP_BUTTON_IS_SHOWN_PROPERTY
          Constant used by property change events to signal that a JWizard's ability to provide additional help has changed.
static java.lang.String LAST_ACTION
          Instruction to advance to the last step.
static java.lang.String NEXT_ACTION
          Instruction to advance to the next step.
static java.lang.String PAGE_EDITOR_PROPERTY
          Constant used by property change events to signal that a JWizard's page editor has changed.
static java.lang.String TITLE_FONT_PROPERTY
          Constant used by property change events to signal that a JWizard's title font has changed.
static java.lang.String WIZARD_MODEL_PROPERTY
          Constant used by property change events to signal that a JWizard's model has changed.
 
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
JWizard()
          Creates a JWizard with a default wizard model.
JWizard(WizardModel wizardModel)
          Creates a JWizard with the specified underlying wizard model and no accessory panel.
JWizard(WizardModel wizardModel, javax.swing.JComponent accessory)
          Creates a JWizard with the specified wizard model and accessory panel.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener listener)
          Adds an ActionListener.
protected  WizardModel createDefaultWizardModel()
          Creates and returns a default wizard model.
 javax.swing.JDialog createDialog(java.awt.Frame frame, java.lang.String dialogTitle)
          Creates and returns an instance of JDialog that contains this wizard and that is centered in frame.
 void doBack()
          Returns this wizard to the previous step.
 void doCancel()
          Cancels this wizard.
 void doClose()
          Closes this wizard.
 boolean doFinish()
          Finishes this wizard.
 void doHelp()
          Indicates that additional help is needed.
 boolean doLast()
          Moves this wizard to the last page.
 boolean doNext()
          Advances this wizard to the next step.
 void editPage(Page page)
          Called by the UI to sets the specified page as being the currently edited page.
protected  void fireActionPerformed(java.lang.String command)
          Notifies all listeners that have registered interest for notification on this event type.
 javax.accessibility.AccessibleContext getAccessibleContext()
          Gets the AccessibleContext associated with this JWizard.
 javax.swing.JComponent getAccessory()
          Returns the accessory component.
 java.awt.event.ActionListener[] getActionListeners()
          Returns an array of all the ActionListeners added to this JWizard with addActionListener.
 boolean getControlButtonsAreShown()
          Returns whether or not this wizard should show the Next button, Back button, Finish button, etc.
 int getDefaultAccessory()
          Returns the constant that indicates the type of accessory panel to use if the installed accessory is null.
 PageEditor getDefaultPageEditor(java.lang.Class pageClass)
          Returns the default page editor for the specified class.
 java.awt.Component getEditorComponent()
          Returns the component editing the current page.
 int getFinishButtonMnemonic()
          Returns the Finish button's mnemonic.
 java.lang.String getFinishButtonText()
          Returns the Finish button's text.
 java.lang.String getFinishButtonToolTipText()
          Returns the Finish button's tooltip text.
 boolean getHelpButtonIsShown()
          Returns whether or not this wizard should contains a Help button.
 WizardModel getModel()
          Returns the model underlying this wizard component.
 PageEditor getPageEditor()
          Returns the page editor editing the current page.
protected  PageEditor getPageEditor(Page page)
          Returns an editor that should edit the specified page.
 java.awt.Font getTitleFont()
          Returns the font to use for this wizard's titles.
 WizardUI getUI()
          Returns the look and feel delegate that renders this object.
 java.lang.String getUIClassID()
          Returns the UIDefaults key used to look up the name of the swing.plaf.ComponentUI class that defines the look and feel for this component.
protected  void initializeDefaultPageEditors()
          Creates default cell editors for objects, numbers, and boolean values.
 void removeActionListener(java.awt.event.ActionListener listener)
          Removes an ActionListener.
 void setAccessory(javax.swing.JComponent accessoryComponent)
          Sets this wizard's accessory component, which gets displayed along side the current step.
 void setControlButtonsAreShown(boolean controlButtonsAreShown)
          Sets whether of not this wizard should contains its Next button, Back button, Finish button, etc.
 void setDefaultAccessory(int defaultAccessory)
          Set the constant that indicates the type of accessory panel to use when the installed accessory panel is null.
 void setDefaultPageEditor(java.lang.Class pageClass, PageEditor editor)
          Sets a default page editor to be used for pages of the specified class.
 void setFinishButtonMnemonic(char finishButtonMnemonic)
          Sets the mnemonic key for this wizard's Finish button using a character.
 void setFinishButtonMnemonic(int finishButtonMnemonic)
          Sets the mnemonic key for this wizard's Finish button using an integer.
 void setFinishButtonText(java.lang.String finishButtonText)
          Sets the text of this wizard's Finish button.
 void setFinishButtonToolTipText(java.lang.String finishButtonToolTipText)
          Sets the tooltip text of this wizard's Finish button.
 void setHelpButtonIsShown(boolean helpButtonIsShown)
          Sets whether or not the Help button is rendererd.
 void setModel(WizardModel model)
          Sets the model underlying this wizard component.
 void setPageEditor(PageEditor pageEditor)
          Sets the current page editor.
 void setTitleFont(java.awt.Font titleFont)
          Sets the title font to use in this wizard.
 void setUI(WizardUI newUI)
          Sets the look and feel delegate for this wizard component.
 int showDialog(java.awt.Frame frame, java.lang.String dialogTitle)
          Places this wizard in a modal dialog and blocks until the dialog is either canceled and finished.
 void updateUI()
          Resets the UI property with the value from the current look and feel.
 
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, paramString, 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

ACCESSORY_COMPONENT_PROPERTY

public static final java.lang.String ACCESSORY_COMPONENT_PROPERTY
Constant used by property change events to signal that a JWizard's accessory component has changed.

See Also:
setAccessory(javax.swing.JComponent), Constant Field Values

FINISH_BUTTON_MNEMONIC_PROPERTY

public static final java.lang.String FINISH_BUTTON_MNEMONIC_PROPERTY
Constant used by property change events to signal that a JWizard's Finish button mnemonic has changed.

Since:
1.4
See Also:
setFinishButtonMnemonic(int), Constant Field Values

FINISH_BUTTON_TEXT_PROPERTY

public static final java.lang.String FINISH_BUTTON_TEXT_PROPERTY
Constant used by property change events to signal that a JWizard's Finish button text has changed.

Since:
1.4
See Also:
setFinishButtonText(java.lang.String), Constant Field Values

FINISH_BUTTON_TOOL_TIP_TEXT_PROPERTY

public static final java.lang.String FINISH_BUTTON_TOOL_TIP_TEXT_PROPERTY
Constant used by property change events to signal that a JWizard's Finish button tooltip text has changed.

Since:
1.4
See Also:
setFinishButtonToolTipText(java.lang.String), Constant Field Values

HELP_BUTTON_IS_SHOWN_PROPERTY

public static final java.lang.String HELP_BUTTON_IS_SHOWN_PROPERTY
Constant used by property change events to signal that a JWizard's ability to provide additional help has changed.

See Also:
setHelpButtonIsShown(boolean), Constant Field Values

CONTROL_BUTTONS_ARE_SHOWN_PROPERTY

public static final java.lang.String CONTROL_BUTTONS_ARE_SHOWN_PROPERTY
Constant used by property change events to signal that a JWizard's desire to display the controls buttons has changed.

See Also:
setControlButtonsAreShown(boolean), Constant Field Values

PAGE_EDITOR_PROPERTY

public static final java.lang.String PAGE_EDITOR_PROPERTY
Constant used by property change events to signal that a JWizard's page editor has changed.

See Also:
setPageEditor(sos.wizard.PageEditor), Constant Field Values

TITLE_FONT_PROPERTY

public static final java.lang.String TITLE_FONT_PROPERTY
Constant used by property change events to signal that a JWizard's title font has changed.

See Also:
setTitleFont(java.awt.Font), Constant Field Values

WIZARD_MODEL_PROPERTY

public static final java.lang.String WIZARD_MODEL_PROPERTY
Constant used by property change events to signal that a JWizard's model has changed.

See Also:
setModel(sos.wizard.WizardModel), Constant Field Values

DEFAULT_ACCESSORY_PROPERTY

public static final java.lang.String DEFAULT_ACCESSORY_PROPERTY
Constant used by property change events to signal that a JWizard's default accessory preference has changed.

See Also:
setDefaultAccessory(int), Constant Field Values

BACK_ACTION

public static final java.lang.String BACK_ACTION
Instruction to return to the previous step.

See Also:
Constant Field Values

CANCEL_ACTION

public static final java.lang.String CANCEL_ACTION
Instruction to cancel the wizard.

See Also:
Constant Field Values

CLOSE_ACTION

public static final java.lang.String CLOSE_ACTION
Instruction to close the finished wizard.

See Also:
Constant Field Values

FINISH_ACTION

public static final java.lang.String FINISH_ACTION
Instruction to finish the wizard.

See Also:
Constant Field Values

HELP_ACTION

public static final java.lang.String HELP_ACTION
Instruction to provide additional help.

See Also:
Constant Field Values

LAST_ACTION

public static final java.lang.String LAST_ACTION
Instruction to advance to the last step.

See Also:
Constant Field Values

NEXT_ACTION

public static final java.lang.String NEXT_ACTION
Instruction to advance to the next step.

See Also:
Constant Field Values

DEFAULT_ACCESSORY_NONE

public static final int DEFAULT_ACCESSORY_NONE
Constant that signals not to use a default accessory component.

See Also:
setDefaultAccessory(int), Constant Field Values

DEFAULT_ACCESSORY_STEPS

public static final int DEFAULT_ACCESSORY_STEPS
Constant that signals to use a list of steps as the default accessory component.

See Also:
setDefaultAccessory(int), Constant Field Values
Constructor Detail

JWizard

public JWizard()
Creates a JWizard with a default wizard model.

See Also:
JWizard(WizardModel)

JWizard

public JWizard(WizardModel wizardModel)
Creates a JWizard with the specified underlying wizard model and no accessory panel.

Parameters:
wizardModel - the underlying wizard model (can be null)

JWizard

public JWizard(WizardModel wizardModel,
               javax.swing.JComponent accessory)
Creates a JWizard with the specified wizard model and accessory panel.

Parameters:
wizardModel - the underlying wizard model (can be null)
accessory - the accessory component to display next to the wizard page (can be null)
Method Detail

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Adds an ActionListener.

The ActionListener will receive an ActionEvent when one of the wizard component's buttons has been pressed.

Parameters:
listener - the ActionListener that is to be notified
See Also:
doNext(), doBack(), doCancel(), doClose(), doHelp(), doFinish(), doLast(), removeActionListener(java.awt.event.ActionListener)

createDefaultWizardModel

protected WizardModel createDefaultWizardModel()
Creates and returns a default wizard model. This method is called by the constructor when no wizard model is supplied.

Returns:
a default wizard model

createDialog

public javax.swing.JDialog createDialog(java.awt.Frame frame,
                                        java.lang.String dialogTitle)
Creates and returns an instance of JDialog that contains this wizard and that is centered in frame.

To display the returned dialog invoke show on it. The dialog will automatically be closed and disposed of when the underlying wizard model finishes. To determine if the dialog closed because the wizard model finished or was canceled, invoke getState on the model.

The size of the returned dialog will be 660 x 400 (as suggested by the Java Look and Feel Design Guidelines Vol. 2) unless its preferred size is larger.

Parameters:
frame - frame for which the returned dialog will be a child and will be centered
dialogTitle - title to be used for the dialog
Returns:
a dialog ready to display this wizard component

doCancel

public void doCancel()
Cancels this wizard. This method is called by the UI when the user presses the Cancel button. Programmers may also invoke this method to cancel the wizard programmatically. This method sends an ActionEvent with the action command CANCEL_ACTION.

See Also:
CANCEL_ACTION

doClose

public void doClose()
Closes this wizard. This method is called by the UI when the user presses the Close button. Programmers may also invoke this method to close the wizard programmatically. This method sends an ActionEvent with the action command CLOSE_ACTION.

See Also:
CLOSE_ACTION

doFinish

public boolean doFinish()
Finishes this wizard. This method is called by the UI when the user presses the Finish button. Programmers may also invoke this method to finish the wizard programmatically. This method sends an ActionEvent with the action command FINISH_ACTION.

Returns:
true if this wizard successfully stopped the current editing and invoked finish on the model
See Also:
FINISH_ACTION

doHelp

public void doHelp()
Indicates that additional help is needed. This method is called by the UI when the user presses the Help button. Programmers may also invoke this method to signal help programmatically. This method sends an ActionEvent with the action command HELP_ACTION.

See Also:
HELP_ACTION

doLast

public boolean doLast()
Moves this wizard to the last page. This method is called by the UI when the user presses the Last button. Programmers may also invoke this method to advance the wizard programmatically. This method sends an ActionEvent with the action command LAST_ACTION.

Returns:
true if this wizard successfully stopped the current editing and advanced to the last page
See Also:
LAST_ACTION

doNext

public boolean doNext()
Advances this wizard to the next step. This method is called by the UI when the user presses the Next button. Programmers may also invoke this method to advance the wizard programmatically. This method sends an ActionEvent with the action command NEXT_ACTION.

Returns:
true if this wizard successfully stopped the current editing and advanced to the next page
See Also:
NEXT_ACTION

doBack

public void doBack()
Returns this wizard to the previous step. This method is called by the UI when the user presses the Back button. Programmers may also invoke this method to advance the wizard programmatically. This method sends an ActionEvent with the action command BACK_ACTION.

See Also:
BACK_ACTION

editPage

public void editPage(Page page)
Called by the UI to sets the specified page as being the currently edited page.

This implementation invokes getPageEditor(Page) to determine the editor to use.

Parameters:
page - page to be edited
Throws:
java.lang.NullPointerException - if page is null
See Also:
getPageEditor(Page)

fireActionPerformed

protected void fireActionPerformed(java.lang.String command)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the command parameter.


getAccessibleContext

public javax.accessibility.AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JWizard.

Specified by:
getAccessibleContext in interface javax.accessibility.Accessible
Overrides:
getAccessibleContext in class javax.swing.JComponent
Returns:
the AccessibleContext associated with this JWizard

getAccessory

public javax.swing.JComponent getAccessory()
Returns the accessory component.

Returns:
the accessory component
See Also:
setAccessory(javax.swing.JComponent)

getActionListeners

public java.awt.event.ActionListener[] getActionListeners()
Returns an array of all the ActionListeners added to this JWizard with addActionListener.

Returns:
all of the ActionListeners added or an empty array if no listeners have been added

getControlButtonsAreShown

public boolean getControlButtonsAreShown()
Returns whether or not this wizard should show the Next button, Back button, Finish button, etc.

Returns:
true if this wizard should show the control buttons
See Also:
setControlButtonsAreShown(boolean)

getDefaultAccessory

public int getDefaultAccessory()
Returns the constant that indicates the type of accessory panel to use if the installed accessory is null.

Returns:
ACCESSORY_NONE if this wizard should not have an accessory panel; ACCESSORY_STEPS if this wizard should display a list of steps in the accessory panel
See Also:
setDefaultAccessory(int)

getDefaultPageEditor

public PageEditor getDefaultPageEditor(java.lang.Class pageClass)
Returns the default page editor for the specified class. This implementation is recursive. If a page editor is not registered for pageClass explicitly, then the page editor registered with the superclass is returned. If no page editor is registered for any class along the class hierarchy, then null is returned.

Parameters:
pageClass - the class for which to find the registered default page editor
Returns:
the first registered default page editor up the class hierarchy of pageClass
See Also:
setDefaultPageEditor(java.lang.Class, sos.wizard.PageEditor)

getEditorComponent

public java.awt.Component getEditorComponent()
Returns the component editing the current page.

Returns:
the component editing the current page

getFinishButtonMnemonic

public int getFinishButtonMnemonic()
Returns the Finish button's mnemonic. The returned value will be 0 if setFinishButtonMnemonic has not been called on this wizard. A value of 0 indicates that the UI should determine the button's mnemonic.

Returns:
the integer value of the Finish button's mnemonic key
Since:
1.4
See Also:
setFinishButtonMnemonic(int), setFinishButtonMnemonic(char)

getFinishButtonText

public java.lang.String getFinishButtonText()
Returns the Finish button's text. The returned value will be null if setFinishButtonText has not been called on this wizard. A value of null indicates that the UI should determine the button's text.

Returns:
the text used in the Finish button
Since:
1.4
See Also:
setFinishButtonText(java.lang.String)

getFinishButtonToolTipText

public java.lang.String getFinishButtonToolTipText()
Returns the Finish button's tooltip text. The returned value will be null if setFinishButtonToolTipText has not been called on this wizard. A value of null indicates that the UI should determine the button's tooltip text.

Returns:
the tooltip used for the Finish button
Since:
1.4
See Also:
setFinishButtonToolTipText(java.lang.String)

getHelpButtonIsShown

public boolean getHelpButtonIsShown()
Returns whether or not this wizard should contains a Help button.

Returns:
true if this wizard should include a Help button
See Also:
setHelpButtonIsShown(boolean)

getModel

public WizardModel getModel()
Returns the model underlying this wizard component.

Returns:
the model underlying this wizard component
See Also:
setModel(sos.wizard.WizardModel)

getPageEditor

public PageEditor getPageEditor()
Returns the page editor editing the current page.

Returns:
the page editor editing the current page

getPageEditor

protected PageEditor getPageEditor(Page page)
Returns an editor that should edit the specified page. This implementation returns the default page editor associated with the page's class. Subclasses may override this method to provide a different mechanism of associating editors with pages.

Parameters:
page - the page to be edited
Returns:
an editor to edit page
Throws:
java.lang.NullPointerException - if page is null
See Also:
setDefaultPageEditor(java.lang.Class, sos.wizard.PageEditor)

getTitleFont

public java.awt.Font getTitleFont()
Returns the font to use for this wizard's titles.

Returns:
the this wizard's title font
See Also:
setTitleFont(java.awt.Font)

getUI

public WizardUI getUI()
Returns the look and feel delegate that renders this object.

Returns:
the UI for this wizard component

getUIClassID

public java.lang.String getUIClassID()
Returns the UIDefaults key used to look up the name of the swing.plaf.ComponentUI class that defines the look and feel for this component.

Overrides:
getUIClassID in class javax.swing.JComponent
Returns:
the UIDefaults key for a ComponentUI subclass

initializeDefaultPageEditors

protected void initializeDefaultPageEditors()
Creates default cell editors for objects, numbers, and boolean values.

See Also:
DefaultCellEditor

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Removes an ActionListener.

Parameters:
listener - the ActionListener to remove
See Also:
addActionListener(java.awt.event.ActionListener)

setAccessory

public void setAccessory(javax.swing.JComponent accessoryComponent)
Sets this wizard's accessory component, which gets displayed along side the current step. This accessory component is typically a list of steps, a graphic, or additional help information. A null value indicates that there is no accessory component.

Parameters:
accessoryComponent - component to display next to the current page (may be null)
See Also:
getAccessory()

setControlButtonsAreShown

public void setControlButtonsAreShown(boolean controlButtonsAreShown)
Sets whether of not this wizard should contains its Next button, Back button, Finish button, etc.

Parameters:
controlButtonsAreShown - true if this wizard should show its control buttons
See Also:
getControlButtonsAreShown()

setDefaultAccessory

public void setDefaultAccessory(int defaultAccessory)
Set the constant that indicates the type of accessory panel to use when the installed accessory panel is null. This implementation recognizes the following constants: DEFAULT_ACCESSORY_NONE if this wizard should not have an accessory panel and DEFAULT_ACCESSORY_STEPS if this wizard should have a list of steps.

Parameters:
defaultAccessory -
See Also:
getDefaultAccessory(), DEFAULT_ACCESSORY_NONE, DEFAULT_ACCESSORY_STEPS, setAccessory(javax.swing.JComponent)

setDefaultPageEditor

public void setDefaultPageEditor(java.lang.Class pageClass,
                                 PageEditor editor)
Sets a default page editor to be used for pages of the specified class. If editor is null, removes the default editor for the page class.

Parameters:
pageClass - pages with this class should by default use editor
editor - default page editor to be used for this pageClass
See Also:
getDefaultPageEditor(java.lang.Class)

setFinishButtonMnemonic

public void setFinishButtonMnemonic(int finishButtonMnemonic)
Sets the mnemonic key for this wizard's Finish button using an integer. If finishButtonMnemonic is 0, the UI will determine the button's mnemonic.

The following sample code sets the Finish button's mnemonic to "L"

  wizard.setFinishButtonMnemonic( KeyEvent.VK_L );
 

Parameters:
finishButtonMnemonic - integer value of the Finish button's mnemonic key
Since:
1.4
See Also:
setFinishButtonMnemonic(char), getFinishButtonMnemonic()

setFinishButtonMnemonic

public void setFinishButtonMnemonic(char finishButtonMnemonic)
Sets the mnemonic key for this wizard's Finish button using a character.

Parameters:
finishButtonMnemonic - character value of the Finish button's mnemonic key
Since:
1.4
See Also:
setFinishButtonMnemonic(int), getFinishButtonMnemonic()

setFinishButtonText

public void setFinishButtonText(java.lang.String finishButtonText)
Sets the text of this wizard's Finish button. If finishButtonText is null, the UI will determine the button's text.

Parameters:
finishButtonText - the Finish button's text (may be null)
Since:
1.4
See Also:
setFinishButtonText(java.lang.String), getFinishButtonText()

setFinishButtonToolTipText

public void setFinishButtonToolTipText(java.lang.String finishButtonToolTipText)
Sets the tooltip text of this wizard's Finish button. If finishButtonToolTipText is null, the UI will determine the button's tooltip text.

Parameters:
finishButtonToolTipText - the Finish button's tooltip text (may be null)
Since:
1.4
See Also:
setFinishButtonToolTipText(java.lang.String), getFinishButtonToolTipText()

setHelpButtonIsShown

public void setHelpButtonIsShown(boolean helpButtonIsShown)
Sets whether or not the Help button is rendererd.

Parameters:
helpButtonIsShown - true if the Help button should be shown
See Also:
getHelpButtonIsShown()

setModel

public void setModel(WizardModel model)
Sets the model underlying this wizard component. The model is used to determine the pages and steps in the wizard and when the control buttons are enabled.

Parameters:
model - model on which this wizard component should be based
See Also:
getModel()

setPageEditor

public void setPageEditor(PageEditor pageEditor)
Sets the current page editor.

Parameters:
pageEditor - new editor to edit the current page
See Also:
getPageEditor()

setTitleFont

public void setTitleFont(java.awt.Font titleFont)
Sets the title font to use in this wizard.

Parameters:
titleFont - font to use in wizard titles
See Also:
getTitleFont()

setUI

public void setUI(WizardUI newUI)
Sets the look and feel delegate for this wizard component.

Parameters:
newUI - the new UI delegate

showDialog

public int showDialog(java.awt.Frame frame,
                      java.lang.String dialogTitle)
Places this wizard in a modal dialog and blocks until the dialog is either canceled and finished.

Parameters:
frame - dialog's parent
dialogTitle - dialog's title
Returns:
the state of the underlying model when the dialog is disposed
See Also:
WizardModel.getState()

updateUI

public void updateUI()
Resets the UI property with the value from the current look and feel.

Overrides:
updateUI in class javax.swing.JComponent

Side of Software
Wizard Library 1.6

Copyright 2004-07 Side of Software (SOS). All rights reserved.