|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sri.emo.wizard.AbstractWizard com.sri.emo.wizard.branch.BranchingWizard
public class BranchingWizard
Title:
Description:
Copyright: Copyright (c) 2003
Company:
Field Summary | |
---|---|
(package private) boolean |
finished
Internal boolean flag -- if finished then page history's index will include the last page. |
Constructor Summary | |
---|---|
BranchingWizard(WizardMonitor wizMonitor,
BranchNode[] steps)
Constructor that takes a monitor and an array of steps. |
Method Summary | |
---|---|
WizardPage |
backupToPage(Serializable pageKey)
Allows programmatic rewinding to a previous page. |
protected void |
checkAgainstIllegalJump(int pageIndex)
Checks that there were no illegally jumping forward moves caused by parameter manipulation. |
protected Integer |
convertKeyToPageId(Serializable pageId)
Forgivingly converts page id to an internal integer. |
boolean |
equals(Object parm1)
Override of Object.equals to check field by field. |
protected int |
findWizardPageIndex(WizardPage toFind)
Find the wizard page index so we can define what the next page is. |
Map |
getAllData()
Retrieve all the data for the wizard keyed by page id. |
protected BranchNode[] |
getAllSteps()
Retrieve all the steps for the wizard. |
int |
getCurrentPageIndex()
Retrieve the index of the current wizard. |
protected WizardPage |
getInitialPage()
Retrieve the initial page for the wizard. |
List |
getMainStepHistory()
Will return a history of steps without accounting for any of the branching |
WizardPage |
getPageById(Serializable s)
Retrieve a page by a given id. |
List |
getStepHistory()
Retrieve all Pages in the order that the person has stepped through them. |
int |
hashCode()
Returns a hash code value for the object. |
protected boolean |
includeInMainStep(BranchNode node)
|
protected boolean |
isNeedingRollback(WizardPage src)
Checks the backtrace for presence of the given wizard page. |
WizardPage |
next(WizardPage src,
Serializable newData)
Execute the next page in the wizard. |
WizardPage |
next(WizardPage src,
Serializable newData,
Serializable allData)
|
protected boolean |
onNextPage(WizardPage previousPage,
WizardPage nextPage,
Serializable previousPageData)
Template method that gets called after the next page has been determined in the sequence. |
WizardPage |
previous()
Backtracks the stack. |
Object |
processFinish(WizardPage src,
Serializable data,
Map additonalParams)
Processes the final finish and returns some sort of data that can be whatever is desired. |
protected void |
rollbackBacktrace(WizardPage src)
Rolls back the backtrace stack if the src page is already on the stack, indicating that the browser pushed the back button. |
String |
toString()
Override of toString(). |
Methods inherited from class com.sri.emo.wizard.AbstractWizard |
---|
begin, destroy, getBackTrace, getCurrentPage, getId, getMonitor, getSummary, getTitle, setCurrentPage, setId, setSummary, setTitle |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
boolean finished
Constructor Detail |
---|
public BranchingWizard(WizardMonitor wizMonitor, BranchNode[] steps)
wizMonitor
- the monitor for events occuring in the wizard.steps
- the WizardPage array ordered by the order
they appear. Index 0 == first page.Method Detail |
---|
protected WizardPage getInitialPage()
getInitialPage
in class AbstractWizard
public int getCurrentPageIndex()
public WizardPage next(WizardPage src, Serializable newData, Serializable allData) throws WizardException
The SequentialWizard implementation allows for the browser back button to be pressed and still achieve status quo. What happens is that if we detect that the browser back button was ealier pressed (we can tell because the src page parameter is already on the backtrace stack), then we rollback to the page previous to the src page and re-execute.
src
- the wizard page sourcenewData
- the data for the previous page.
WizardException
- upon error
ArrayIndexOutOfBoundsException
- if next was clicked and
there should be no next button (ie last page)public WizardPage next(WizardPage src, Serializable newData) throws WizardException
The SequentialWizard implementation allows for the browser back button to be pressed and still achieve status quo. What happens is that if we detect that the browser back button was ealier pressed (we can tell because the src page parameter is already on the backtrace stack), then we rollback to the page previous to the src page and re-execute.
next
in interface Wizard
next
in class AbstractWizard
src
- the wizard page sourcenewData
- the data for the previous page.
WizardException
- upon error
ArrayIndexOutOfBoundsException
- if next was clicked and
there should be no next button (ie last page)protected Integer convertKeyToPageId(Serializable pageId)
pageId
- Serializable the requested page id.
public WizardPage backupToPage(Serializable pageKey) throws ArrayIndexOutOfBoundsException, IllegalArgumentException
pageId
- Serializable the page key.
ArrayIndexOutOfBoundsException
IllegalArgumentException
protected boolean onNextPage(WizardPage previousPage, WizardPage nextPage, Serializable previousPageData) throws WizardException
previousPage
- The previousPage that was displaytednextPage
- WizardPage the next page that is about to be displayed.previousPageData
- Serializable the previously entered data from the
last page where the user clicked 'next'.
WizardException
- upon error.protected void checkAgainstIllegalJump(int pageIndex)
src
- WizardPage the wizard page we're checking against.
IllegalStateException
- if the check fails.public WizardPage getPageById(Serializable s)
s
- Serializable
protected BranchNode[] getAllSteps()
protected boolean isNeedingRollback(WizardPage src)
src
- WizardPage the source wizard page.
protected void rollbackBacktrace(WizardPage src)
src
- WizardPage the source of the 'next' event, so we rollback
so that it is no longer on the backtrace.protected int findWizardPageIndex(WizardPage toFind)
toFind
- the wizard page to find.
IllegalStateException
- if we're unable to find the page.public Map getAllData() throws WizardException
WizardException
- upon errorpublic List getStepHistory() throws WizardException
WizardException
- upon retrieval order.public List getMainStepHistory() throws WizardException
WizardException
protected boolean includeInMainStep(BranchNode node)
public boolean equals(Object parm1)
equals
in class AbstractWizard
parm1
- the object SequentialWizard
public int hashCode()
hashCode
in class AbstractWizard
public Object processFinish(WizardPage src, Serializable data, Map additonalParams) throws WizardException
processFinish
in interface Wizard
processFinish
in class AbstractWizard
src
- WizardPage the source of the event.data
- Serializable the data given during wht wizard post.additonalParams
- anything that the underlying wizard needs. The
values are set by the Application Controller.
WizardException
- upon error.public WizardPage previous() throws WizardException
Retrieve the first wizard page and initialize any special data for the Wizard.
previous
in interface Wizard
previous
in class AbstractWizard
WizardException
- upon error.public String toString()
toString
in class AbstractWizard
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |