com.borland.primetime.wizard
Class BasicWizardPage

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.borland.primetime.wizard.BasicWizardPage

public class BasicWizardPage
extends javax.swing.JPanel
implements WizardPage

BasicWizardPage is a simple implementation of the WizardPage interface. BasicWizardPage provides the two 'classic' styles of Wizard page layout, the first (STYLE_REGULAR) gives room for a moderate number of components, while the second (STYLE_COMPLEX) makes room for more components for more complicated WizardPages.

STYLE_REGULAR includes a large icon (roughly 150x300) along the left side of the page (set using the 'largeIcon' property), a one-line bold page title along the top of the page (set using the 'pageTitle' property), and a multi-line instructions panel (set using the 'instructions' property) below it. Components added to a subclass of this page will appear in the bottom-right remaining portion of the page.

STYLE_COMPLEX includes a smaller icon in the top-left corner of the page (set using the 'smallIcon' property), a one-line bold page title along the top of the page (set using the 'pageTitle' property), and a multi-line instructions panel (set using the 'instructions' property) below it. Components added to a subclass of this page will appear in remaining real estate along the bottom of the page.

Make subclasses of this and use the Visual Designer to quickly assemble a Wizard.

See Also:
Wizard, WizardPage, Serialized Form

Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
protected  javax.swing.Icon largeIcon
          Storage for the large icon.
protected  javax.swing.Icon smallIcon
          Storage for the small icon.
protected  int style
          Storage for the page style
static int STYLE_COMPLEX
          For use with the 'pageStyle' property.
static int STYLE_REGULAR
          For use with the 'pageStyle' property.
protected  WizardHost wizardHost
          Storage for the WizardHost
 
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
 
Constructor Summary
BasicWizardPage()
           
 
Method Summary
 void activated(WizardHost host)
           WizardPage interface method
protected  void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)
           
 void checkPage()
           If hosted in a BasicWizard instance, this method is called when this WizardPage is finished, as in the user has clicked next or finish.
 void deactivated()
           WizardPage interface method
 java.lang.String getInstructions()
          Returns this WizardPage's instructions text.
 javax.swing.Icon getLargeIcon()
          Returns this WizardPage's large icon.
 java.awt.LayoutManager getLayout()
           
 javax.swing.JComponent getPageComponent(WizardHost host)
           WizardPage interface method
 int getPageStyle()
          Returns the current page style for this WizardPage.
 java.lang.String getPageTitle()
          Returns this WizardPage's page title.
 javax.swing.Icon getSmallIcon()
          Returns this WizardPage's small icon.
 WizardHost getWizardHost()
          Returns this WizardPage's WizardHost instance.
 void setInstructions(java.lang.String text)
          Sets the instructions text for this WizardPage.
 void setLargeIcon(javax.swing.Icon icon)
          Sets the large icon for this WizardPage.
 void setLayout(java.awt.LayoutManager layout)
           
 void setPageStyle(int style)
          Sets the style for this WizardPage.
 void setPageTitle(java.lang.String text)
          Sets the title for this WizardPage.
 void setSmallIcon(javax.swing.Icon icon)
          Sets the small icon for this WizardPage.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STYLE_REGULAR

public static final int STYLE_REGULAR
For use with the 'pageStyle' property. STYLE_REGULAR displays the largeIcon along the left portion of the page - leaving a moderate (yet standard) amount of screen real estate for component layout.

STYLE_COMPLEX

public static final int STYLE_COMPLEX
For use with the 'pageStyle' property. STYLE_COMPLEX displays the smallIcon in the top-left corner of the page - leaving more real estate for component layout.

style

protected int style
Storage for the page style

wizardHost

protected WizardHost wizardHost
Storage for the WizardHost

largeIcon

protected javax.swing.Icon largeIcon
Storage for the large icon.

smallIcon

protected javax.swing.Icon smallIcon
Storage for the small icon.
Constructor Detail

BasicWizardPage

public BasicWizardPage()
Method Detail

setPageStyle

public void setPageStyle(int style)
Sets the style for this WizardPage. The style can be one of two values: STYLE_REGULAR (default), which uses a large icon along the entire left portion of the page, or STYLE_COMPLEX, which uses a smaller icon in the upper left hand corner allowing more screen real estate for components.
Parameters:
style - The style to use for this WizardPage: valid values are: STYLE_REGULAR (default), and STYLE_COMPLEX

getPageStyle

public int getPageStyle()
Returns the current page style for this WizardPage.
Returns:
The current page style (STYLE_REGULAR or STYLE_COMPLEX)

setLargeIcon

public void setLargeIcon(javax.swing.Icon icon)
Sets the large icon for this WizardPage. The large icon is only displayed When using the STYLE_REGULAR style of WizardPage. This icon should be roughly 150x300 pixels in size, as it will span the entire left side of the page.
Parameters:
icon - The large icon to use for this WizardPage when displayed using the STYLE_REGULAR (default) style.

getLargeIcon

public javax.swing.Icon getLargeIcon()
Returns this WizardPage's large icon.
Returns:
This WizardPage's large icon

setSmallIcon

public void setSmallIcon(javax.swing.Icon icon)
Sets the small icon for this WizardPage. The small icon is only displayed When using the STYLE_COMPLEX style of WizardPage. This icon should be roughly 32x32 pixels in size.
Parameters:
icon - The small icon to use for this WizardPage when displayed using the STYLE_COMPLEX style.

getSmallIcon

public javax.swing.Icon getSmallIcon()
Returns this WizardPage's small icon.
Returns:
This WizardPage's small icon

setPageTitle

public void setPageTitle(java.lang.String text)
Sets the title for this WizardPage. This one-line bold title displays across the top of the page. It should be a one-line summary of the contents of the page, like: "Enter a filename for your new project.".
Parameters:
text - The text to use as the title for this WizardPage

getPageTitle

public java.lang.String getPageTitle()
Returns this WizardPage's page title.
Returns:
This WizardPage's page title

setInstructions

public void setInstructions(java.lang.String text)
Sets the instructions text for this WizardPage. This multi-line text panel that appear just below the page title across the top of the page. This should be a fairly descriptive set of directions for filling out the page.
Parameters:
text - The instructions text for this WizardPage

getInstructions

public java.lang.String getInstructions()
Returns this WizardPage's instructions text.
Returns:
This WizardPage's instructions text

getWizardHost

public WizardHost getWizardHost()
Returns this WizardPage's WizardHost instance.
Returns:
This WizardPage's WizardHost instance

getPageComponent

public javax.swing.JComponent getPageComponent(WizardHost host)

WizardPage interface method

Returns 'this' as the JComponent to act as the UI for this WizardPage.

Specified by:
getPageComponent in interface WizardPage
Parameters:
host - The WizardHost hosting this Wizard.
Returns:
'this' to act as the UI for this WizardPage.

activated

public void activated(WizardHost host)

WizardPage interface method

Called when this WizardPage is activated as the 'current' page in the Wizard.

Specified by:
activated in interface WizardPage
Parameters:
host - The WizardHost hosting this Wizard. NOTE: For pages that have required fields - the WizardHost interface can be used to enable/ disable the 'Next' and 'Finish' buttons.

deactivated

public void deactivated()

WizardPage interface method

Called when this WizardPage is deactivated, and is no longer the 'current' page in the Wizard.

Specified by:
deactivated in interface WizardPage

checkPage

public void checkPage()
               throws VetoException

If hosted in a BasicWizard instance, this method is called when this WizardPage is finished, as in the user has clicked next or finish. If any validation errors exist on the page, a VetoException should be thrown at this time.

Throws:
VetoException - If there are any validation errors on the page.

setLayout

public void setLayout(java.awt.LayoutManager layout)
Overrides:
setLayout in class java.awt.Container

getLayout

public java.awt.LayoutManager getLayout()
Overrides:
getLayout in class java.awt.Container

addImpl

protected void addImpl(java.awt.Component comp,
                       java.lang.Object constraints,
                       int index)
Overrides:
addImpl in class java.awt.Container