|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kiwi.ui.WizardPanelSequence
This class serves as a factory of WizardPanel
s for a
WizardView
. A WizardPanelSequence
maintains a set
of WizardPanel
s and a Config
object. When a
WizardPanel
is added to the sequence, a reference to the
Config
object is passed to the panel. The panel may use this
Config
object to store results from user input or to look up
the current or default values for its input fields.
Whenever the value of a property is changed or a property is added to or
removed from the Config
object, the Config
object notifies the WizardPanelSequence
via a
ChangeEvent
. Subclassers may override the
stateChanged()
method to handle these events.
The goal of the Wizard
family of classes was to provide a
framework for creating wizards that was as flexible as possible, without
creating a large amount of classes and interfaces to achieve that goal.
Therefore the APIs for these classes may at first appear counterintuitive
or inelegant. If they are found to be too cumbersome, they will be changed
in a future release of Kiwi.
WizardView
,
WizardPanel
,
Config
,
ChangeEvent
Field Summary | |
protected Config |
config
The configuration object for this sequence. |
protected int |
currentIndex
The index of the currently-selected WizardPanel . |
protected Vector |
panels
The list of WizardPanel s. |
Constructor Summary | |
WizardPanelSequence()
Construct a new WizardPanelSequence . |
Method Summary | |
void |
addChangeListener(ChangeListener listener)
Add a ChangeListener to this object's list of listeners. |
void |
addPanel(WizardPanel panel)
Add a WizardPanel to this sequence. |
void |
addPanels(WizardPanel[] panels)
Add an array of WizardPanel s to this sequence. |
boolean |
canMoveBackward()
Determine if the user is allowed to move to the previous panel. |
boolean |
canMoveForward()
Determine if the user is allowed to move to the next panel. |
protected void |
fireChangeEvent()
Fire a change event. |
Config |
getConfig()
Get a reference to this WizardPanelSequence 's
Config object. |
WizardPanel |
getNextPanel()
Get the next panel from this sequence. |
WizardPanel |
getPreviousPanel()
Get the previous panel from this sequence. |
boolean |
isLastPanel()
Determine if the current panel is the last panel in the sequence. |
void |
removeChangeListener(ChangeListener listener)
Remove a ChangeListener from this object's list of
listeners. |
void |
reset()
Reset the sequence. |
void |
stateChanged(ChangeEvent evt)
Handle ChangeEvent s fired by the WizardPanel s
that belong to this sequence. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected Vector panels
WizardPanel
s.protected int currentIndex
WizardPanel
.protected Config config
Constructor Detail |
public WizardPanelSequence()
WizardPanelSequence
.Method Detail |
public final void addPanel(WizardPanel panel)
WizardPanel
to this sequence. All panels should be
added before the sequence is used to construct a WizardView
.panel
- The panel to add.addPanels(kiwi.ui.WizardPanel[])
public final void addPanels(WizardPanel[] panels)
WizardPanel
s to this sequence. All panels
should be added before the sequence is used to construct a
WizardView
.panels
- The panels to add.addPanel(kiwi.ui.WizardPanel)
public void reset()
getNextPanel()
will return the first panel in the sequence.getNextPanel()
public final Config getConfig()
WizardPanelSequence
's
Config
object.Config
object.public WizardPanel getNextPanel()
panels
vector and
increments the currentIndex
variable only if the end of
the sequence has not been reached and the next panel is
reachable (e.g., if canMoveForward()
returns true).WizardView
.public WizardPanel getPreviousPanel()
panels
vector and
decrements the currentIndex
variable only if the beginning
of the sequence has not been reached and the previous panel is
reachable (e.g., if canMoveBackward()
returns true).WizardView
.public boolean isLastPanel()
WizardView
changes its Next button to a
Finish button.public boolean canMoveForward()
public boolean canMoveBackward()
public void stateChanged(ChangeEvent evt)
ChangeEvent
s fired by the WizardPanel
s
that belong to this sequence. The default implementation does nothing;
subclassers may wish to add logic to determine (based on the current
values of properties in the Config
object) whether movement
to the next or previous panel is allowed, or to determine which panel
will be displayed next, for example.evt
- The event. The source of the event is the
WizardPanel
that fired it.EventObject.getSource()
public void addChangeListener(ChangeListener listener)
ChangeListener
to this object's list of listeners.listener
- The listener to add.public void removeChangeListener(ChangeListener listener)
ChangeListener
from this object's list of
listeners.listener
- The listener to remove.protected void fireChangeEvent()
WizardView
that owns this sequence) that the state of this
WizardPanelSequence
has changed. Subclassers may wish to
call this method from the body of the stateChanged()
method if a change in the Config
object has changed the
state of this WizardPanelSequence
in a way that will
affect the appearance of the WizardView
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |