|
Oracle JEWT API Reference Release 4.2.24.0.0 B12199-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--oracle.bali.ewt.painter.PaintContextComponent | +--oracle.bali.ewt.LWComponent | +--oracle.bali.ewt.wizard.BaseWizard | +--oracle.bali.ewt.wizard.Wizard | +--oracle.bali.ewt.wizard.dWizard.DWizard
DWizards delegate navigation to a user-supplied object implementing the WizardSequence interface. While most simple wizards can easily be written using the normal wizard functionality, very complex wizards, especially wizards composed of several sub-wizards, may be more easily implemented with this model.
Clients that need to pick a sequence dynamically at runtime may find the DynamicSequence class useful.
A small caveat: in a DWizard, pages are added and removed from the Wizard dynamically. Because of this, the meaning of WizardPage.getIndex() is undefined when used in a DWizard. Clients that need to know the number of the current page (to display, for example, a "Page n of m" title) should use DWizard.getCurrentPageIndex().
A few examples showing page-flow may be helpful. In all these examples, numbers represent pages, and the artistic lines connecting them represent potential "flows" among the pages. All the examples start on the left and end on the right.
1 -- 2 -- 3 -- 4 -- end
In this case, you'd probably just use a single ArraySequence with 4 elements. But if the pages came from multiple sources in your code, it might be easier to have each source give you a WizardSequence for their pages, and compose them together in a SequenceSeries.
3 -- 4 / \ / \ 1 -- 2 7 -- 8 -- end \ / \ / 5 -- 6
OK - this one's a lot more complicated. First, you'll want to form several ArraySequences: [1,2], [3, 4], [5, 6], and [7, 8].
Now, how do we get that fork to work? Presumably, page 2 has some UI widgets on it that let the use choose which path to go down. Subclass DynamicSequence, and override chooseSequence() to return either [3, 4] or [5, 6] based on the state of those widgets on page 2. The DynamicSequence subclass should also add listeners to those widgets and, whenever their state changes, call two methods:
Finally, put [1,2], the DynamicSequence subclass, and [7, 8] into a SequenceSeries.
3 -- 4 / \ / \ 1 -- 2 -------- 5 -- 6 -- end
This is almost the same as the previous example, but instead of allowing the user to choose one of two paths, the user can choose to take a path or ignore it. The solution is almost the same as in the previous example, but your DynamicSequence subclass needs a small change. Instead of returning one of two ArraySequences, your DynamicSequence should return either the ArraySequence [3, 4] or a NullSequence. NullSequences are a special sequence class that implement an empty sequence, i.e., a sequence without any pages.
Again, put the two array sequences and your DynamicSequence subclass into a SequenceSeries.
WizardSequence
,
ArraySequence
,
SequenceSeries
,
DynamicSequence
,
NullSequence
, Serialized FormInner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Fields inherited from class oracle.bali.ewt.wizard.BaseWizard |
MNEMONIC_APPLY, MNEMONIC_CANCEL, MNEMONIC_FINISH, MNEMONIC_HELP, MNEMONIC_NEXT, MNEMONIC_PREVIOUS |
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 | |
DWizard()
Creates an empty DWizard using NullSequence. |
|
DWizard(WizardSequence sequence)
Creates a DWizard. |
Method Summary | |
void |
dispose()
Override to free an memory. |
protected void |
doNext()
Handles presses on the "Next" button. |
protected void |
doPrevious()
Handles presses on the "Previous" button. |
void |
enableButtons()
Updates the enabled state of the buttons in the wizard. |
int |
getCurrentPageIndex()
Returns the zero-based index of the currently selected page. |
WizardPage |
getNextPage(WizardPage page)
An override that delegates to the sequence. |
int |
getPageCount()
Returns the number of pages in the wizard. |
WizardPage |
getPreviousPage(WizardPage page)
An override that delegates to the sequence. |
WizardSequence |
getSequence()
Returns the sequence used by the wizard |
void |
goBackwards()
Moves the wizard to the previous page, if one exists. |
void |
goForward()
Advances the wizard to the next page, if one exists. |
void |
restart()
Restarts the wizard at the beginning of the current sequence |
void |
selectPage(WizardPage page)
Override to always throw an exception. |
void |
setSequence(WizardSequence sequence)
Sets the sequence used by the wizard. |
Methods inherited from class oracle.bali.ewt.wizard.Wizard |
addPage, getMustFinish, pagePropertyChange, removeAllPages, removePage, setMustFinish, setSelectedPage, updateUI |
Methods inherited from class oracle.bali.ewt.LWComponent |
clipToParents, freezeRepaints, getActualAlignment, getActualReadingDirection, getAlignment, getBorderInsets, getDocumentSize, getFill, getPageBounds, getPrintPaintContext, isFocusTraversable, paintChildren, paintComponent, paintImmediateInterior, paintImmediateInterior, paintImmediately, paintOverChildren, printPage, processEvent, repaint, repaintInterior, repaintInterior, setAlignment, setFill, unfreezeRepaints |
Methods inherited from class oracle.bali.ewt.painter.PaintContextComponent |
getBorderContext, getPaintContext, getPaintData, getPaintState, getUIDefaults, setUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setVerifyInputWhenFocusTarget, 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, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, 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 |
Constructor Detail |
public DWizard()
public DWizard(WizardSequence sequence)
sequence
- an object implementing the WizardSequence inteface.Method Detail |
public void restart()
restart
in class BaseWizard
public WizardSequence getSequence()
public void selectPage(WizardPage page)
selectPage
in class BaseWizard
oracle.bali.ewt.wizard.BaseWizard
page
- the page to selectBaseWizard.getSelectedPage()
public int getCurrentPageIndex()
getCurrentPageIndex
in class BaseWizard
WizardPage.getIndex()
public int getPageCount()
getPageCount
in class BaseWizard
public void setSequence(WizardSequence sequence)
public void goForward()
public void goBackwards()
public void enableButtons()
enableButtons
in class BaseWizard
public WizardPage getNextPage(WizardPage page)
getNextPage
in class BaseWizard
oracle.bali.ewt.wizard.BaseWizard
page
- the base pagepublic WizardPage getPreviousPage(WizardPage page)
getPreviousPage
in class BaseWizard
oracle.bali.ewt.wizard.BaseWizard
page
- the base pagepublic void dispose()
dispose
in class Wizard
protected void doNext()
doNext
in class BaseWizard
protected void doPrevious()
doPrevious
in class BaseWizard
|
Oracle JEWT 4.2.24 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |