|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.swing.visuals.wizard2.WizardPageDeck
public class WizardPageDeck
WizardPageDeck is responsible for containing, displaying, and managing the pages in a Wizard object.
One of the main duties of the WizardPageDeck is management of the path. The path is a vector of
wizard page names that defines the traversal order of the pages in the wizard.
Multiple paths through the pages in the Wizard
are supported by allowing the path to be dynamically changed.
Wizard pages may be added in any order, and then the order the pages are shown may be explicitly managed
through the path
object. See Wizard
methods setPath
and appendPath
for more information.
The WizardPageDeck
contains the pages of the wizard, and employs a CardLayout
layout manager for displaying them.
Applications do not directly call the WizardPageDeck
method addPage(String pageName, WizardPageInterface page)
to add pages to a WizardPageDeck
object. Wizard pages are added to the WizardPageDeck
by calling one of the following
Wizard
methods:
These methods then call the WizardPageDeck's methodWizard.addPage(String pageName, WizardPageInterface page)
,
Wizard.addPage(String pageName)
, or
Wizard.addPages(String[] pageNames)
addPage(String pageName, WizardPageInterface page)
to add the pages.
The following methods are available to access the names of page objects contained in the WizardPageDeck
:
getCurrentPageName
,
getFirstPageName
,
getLastPageName
,
getPreviousPageName
, and
getNextPageName
Once the page name is known, the page instance can be obtained through the method getPage(String pageName)
Field Summary | |
---|---|
protected java.awt.CardLayout |
cardLayout
The layout manager for this WizardPageDeck . |
protected java.lang.String |
currentPageName
The name of the current page being shown. |
protected java.util.Vector |
pageShownList
A vector containing pages that have been shown for the first time. |
protected java.util.Map |
pageTable
A pool of available pages in this WizardPageDeck . |
protected java.util.Vector |
path
A vector of page names that specifies the order in which pages are shown |
static java.lang.String |
RB_KEY
|
protected Wizard |
wizard
The Wizard object that contains this WizardPageDeck . |
Constructor Summary | |
---|---|
WizardPageDeck(Wizard wizard)
Creates a WizardPageDeck object to be contained in a Wizard . |
Method Summary | |
---|---|
void |
addPage(java.lang.String pageName,
WizardPageInterface page)
Adds a WizardPageInterface object and its corresponding name to the pageTable . |
protected void |
addPagesToDeck(java.lang.String[] pageNames)
Adds the correspoding WizardPageInterface objects to names pageNames to this WizardPageDeck. |
void |
addToPath(java.lang.String[] pageNames)
The path defines the traversal order of the pages in the wizard. |
void |
appendPath(java.lang.String[] pageNames)
The path defines the traversal order of the pages in the wizard. |
void |
clearPath()
Removes all elements from the current path. |
java.lang.String |
getCurrentPageName()
Returns the name of the page currently being shown in the wizard. |
int |
getCurrentPageNumber()
If the current page name is not null, the value of the page number of the current page being shown is returned. |
java.lang.String |
getFirstPageName()
Returns the name of the first page in the path, or null if path is empty. |
java.lang.String |
getLastPageName()
Returns the name of the last page in the path, or null if path is empty. |
java.lang.String |
getNextPageName()
Returns the name of the page after the current page in the path, or null if the current page is the last page in the path. |
WizardPageInterface |
getPage(java.lang.String pageName)
Returns a WizardPageInterface object corresponding to name pageName , or null
if the object has not yet been created. |
int |
getPageCount()
Returns the final page number on the path. |
java.lang.String |
getPageName(WizardPageInterface page)
Returns the name of the WizardPageInterface object page . |
WizardPageInterface[] |
getPages()
Returns an array of all instantiated pages in the wizard. |
java.lang.String[] |
getPath()
Returns an array containing the names of the pages in the path. |
java.lang.String |
getPreviousPageName()
Returns the name of the page before the current page in the path, or null if the current page is the first page of the path. |
void |
removePage(java.lang.String pageName)
Removes the wizard page corresponding to name pageName from the available pool of pages
in this WizardPageDeck. |
void |
showPage(java.lang.String pageName,
int directionFlag)
Shows the WizardPageInterface object corresponding to page name pageName in this WizardPageDeck . |
Field Detail |
---|
public static final java.lang.String RB_KEY
protected java.util.Vector path
protected java.util.Map pageTable
WizardPageDeck
.
The pageTable
is used to store and retrieve wizard page objects by their name.
The key is the page name, and the corresponding value is WizardPageInterface object. The value corresponding to the page name
is null if the page has not yet been created. The page name/page pair is added to the pageTable
whenever pages are added through the method addPage
.
addPage(java.lang.String, com.sas.swing.visuals.wizard.WizardPageInterface)
protected java.util.Vector pageShownList
protected java.lang.String currentPageName
protected java.awt.CardLayout cardLayout
WizardPageDeck
.
protected Wizard wizard
Wizard
object that contains this WizardPageDeck
.
Constructor Detail |
---|
public WizardPageDeck(Wizard wizard)
WizardPageDeck
object to be contained in a Wizard
. Creates an empty path
.
wizard
- the Wizard object that contains this WizardPageDeckMethod Detail |
---|
public java.lang.String getFirstPageName()
public java.lang.String getLastPageName()
public java.lang.String getPreviousPageName()
public java.lang.String getNextPageName()
public java.lang.String getCurrentPageName()
public void showPage(java.lang.String pageName, int directionFlag)
WizardPageInterface
object corresponding to page name pageName
in this WizardPageDeck
.
An IllegalArgumentException is thrown if the page name pageName
is not in the path.
If the WizardPageInterface
object corresponding to pageName
has not been created because delayed
instantiation was selected in wizard
, then it is first created by calling the Wizard
method createNamedPage
,
and is then added to the WizardPageDeck
.
This method is called from the actionPerformed
method of the wizard's ButtonNavigationPanel
object. It may
also be called directly, in which case directionFlag
should be equal to WizardPageInterface.EXPLICIT_SET
.
If this method is called directly, with the EXPLICIT_SET
bit set, then the current page's hidePage
method
is invoked, with directionFlag
passing directly through.
Before the page is shown, the current page name and number are set, and the wizard title and image are updated.
Also, the page's own showPage
method is invoked passing the directionFlag
parameter. If it is the first time
the page has been shown, then directionFlag
is bitwise inclusive ORed with WizardPageInterface.FIRST_TIME_SHOWN
,
before it is passed.
pageName
- the name of the page to show, this name must be in the pathdirectionFlag
- an integer flag whose bits specify the page that was shown before, relative to page
pageName
on the path. Valid values are WizardPageInterface.PREVIOUS, WizardPageInterface.NEXT, or WizardPageInterface.EXPLICIT_SETWizardPageInterface.PREVIOUS
,
WizardPageInterface.NEXT
,
WizardPageInterface.EXPLICIT_SET
,
Wizard.createNamedPage(java.lang.String)
public void clearPath()
public void addToPath(java.lang.String[] pageNames)
pageNames
array to
the end of the current path. If the correspoding WizardPageInterface objects to the names
pageNames
have been created, then they are added to this WizardPageDeck.
Called from Wizard
's setPath
and addPage
methods.
An IllegalStateException is thrown if pageNames
is null.
pageNames
- the names of the pages to add to the pathappendPath(java.lang.String[])
protected void addPagesToDeck(java.lang.String[] pageNames)
pageNames
to this WizardPageDeck.
Called from addToPath
and appendPath
, if the CREATE_IN_ADVANCE
option is
selected in the Wizard
. Called from
showPage
, after the page is created, if CREATE_WHEN_SHOWN is selected in the
Wizard
.
pageNames
- the names of the pages to add to this WizardPageDeckaddToPath(java.lang.String[])
,
appendPath(java.lang.String[])
,
showPage(java.lang.String, int)
,
Wizard.CREATE_WHEN_SHOWN
,
Wizard.CREATE_IN_ADVANCE
public void appendPath(java.lang.String[] pageNames)
pageNames
to the end.
If the correspoding WizardPageInterface objects to names pageNames
have
been created, then they are added to this WizardPageDeck.
Called from Wizard
method appendPath
.
An IllegalStateException is thrown if pageNames
is null.
pageNames
- an array of page names to be added to the path following the current
page name, replacing any names currently there.public void addPage(java.lang.String pageName, WizardPageInterface page)
pageTable
.
The object page
may have a null value if it has not been instantiated yet.
If the pageTable
contains another page with the same pageName
, or
page
was already added under another name, then an IllegalArgumentException will be thrown.
Called from Wizard methods:
pageName
- the name of the pagepage
- the instance of the page corresponding to the name pageName
, may have a null value if it has not yet been instantiatedpageTable
,
Wizard
public void removePage(java.lang.String pageName)
pageName
from the available pool of pages
in this WizardPageDeck.
An IllegalArgumentException is thrown if pageName
is in the path
.
pageName
- the name of the page to removepublic java.lang.String getPageName(WizardPageInterface page)
page
.
Throws an IllegalArgumentException if the pageTable
does not contain page
, indicating page
was not added to the WizardPageDeck.
page
- a WizardPageInterface objectpageTable
public WizardPageInterface getPage(java.lang.String pageName)
pageName
, or null
if the object has not yet been created. An IllegalArgumentException is thrown if the page corresponding
to pageName
is not found in pageTable
.
pageName
- the name of a WizardPageInterface objectpageTable
public WizardPageInterface[] getPages()
pageTable
, but never created are not returned.
public int getCurrentPageNumber()
public int getPageCount()
public java.lang.String[] getPath()
path
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |