|
Side of Software Wizard Library 1.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sos.wizard.AbstractModel | +--sos.wizard.AbstractWizardModel
A partial implementation of the WizardModel
interface. It handles the registration and notification of listeners
and provides default responses to supportsLast
,
canStepLast
, and canCancel
.
A concrete subclass must implement the following methods:
boolean canFinish() boolean canStepBack() boolean canStepNext() void cancel() throws IllegalStateException void finish() throws IllegalStateException Page getCurrentPage() Object getElementAt(int index) Object getSelectedItem() int getSize() int getState() void stepBack() throws IllegalStateException void stepLast() throws IllegalStateException void stepNext() throws IllegalStateExceptionSubclasses should invoke
firePageChanged
when the
current page changes. This class listens
to the current page. If the page's state changes,
this class automatically checks if any of the canXxx
methods
have changed.
Subclasses should invoke fireStepsAdded
,
fireStepsChanged
,
or fireStepsRemoved
when their steps change.
By default, this class always returns true
for canCancel
and false
for supportsLast
and canStepLast
.
Sublasses may override these for different behavior.
Field Summary |
Fields inherited from interface sos.wizard.WizardModel |
BACK_PROPERTY, CANCEL_PROPERTY, CURRENT_PAGE_PROPERTY, FINISH_PROPERTY, LAST_PROPERTY, NEXT_PROPERTY, STATE_PROPERTY, SUPPORTS_LAST_PROPERTY, WIZARD_CANCELED, WIZARD_FINISHED, WIZARD_FINISHING, WIZARD_IN_PROGRESS |
Constructor Summary | |
AbstractWizardModel()
|
Method Summary | |
void |
addListDataListener(javax.swing.event.ListDataListener listener)
Adds a listener to the list that is notified each time a change to the data model occurs. |
boolean |
canCancel()
Returns true if this wizard can be canceled. |
boolean |
canStepLast()
Returns true if this wizard can accept
the current values and advance to the last page. |
protected void |
firePageChanged(Page oldPage,
Page newPage)
Notifies property change listeners that the current pages has changed from oldPage to newPage . |
protected void |
fireStepsAdded(int index0,
int index1)
Notifies all listeners that steps have been added to the sequence. |
protected void |
fireStepsChanged(int index0,
int index1)
Notifies all listeners that the steps have changed or that the current step has changed. |
protected void |
fireStepsRemoved(int index0,
int index1)
Notifies all listeners that steps have been removed from the sequence. |
void |
removeListDataListener(javax.swing.event.ListDataListener l)
Removes a listener from the list that is notified each time a change to the data model occurs. |
void |
setSelectedItem(java.lang.Object anItem)
Set the selected item. |
boolean |
supportsLast()
Returns true if this wizard has the ability to
skip intermediate pages and advance to the last page. |
Methods inherited from class sos.wizard.AbstractModel |
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface sos.wizard.WizardModel |
cancel, canFinish, canStepBack, canStepNext, finish, getCurrentPage, getElementAt, getSelectedItem, getSize, getState, stepBack, stepLast, stepNext |
Methods inherited from interface sos.wizard.Model |
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener |
Constructor Detail |
public AbstractWizardModel()
Method Detail |
public void addListDataListener(javax.swing.event.ListDataListener listener)
WizardModel
addListDataListener
in interface WizardModel
listener
- the ListDataListener
to be addedpublic boolean canCancel()
WizardModel
true
if this wizard can be canceled.
canCancel
in interface WizardModel
true
if this wizard can be canceled.WizardModel.cancel()
public boolean canStepLast()
WizardModel
true
if this wizard can accept
the current values and advance to the last page.
If this wizard is not in progress
or if this wizard does not support last,
false
is returned.
canStepLast
in interface WizardModel
true
if this wizard can advance to the last pageWizardModel.stepLast()
,
WizardModel.supportsLast()
protected void firePageChanged(Page oldPage, Page newPage)
oldPage
to newPage
.
oldPage
- previous current pagenewPage
- new current pageprotected void fireStepsAdded(int index0, int index1)
index0
- start index of the changeindex1
- end index (inclusive) of the changefireStepsChanged(int, int)
protected void fireStepsChanged(int index0, int index1)
index0
and index1
.
index0
- start index of the changeindex1
- end index (inclusive) of the changefireStepsAdded(int, int)
protected void fireStepsRemoved(int index0, int index1)
index0
- start index of the changeindex1
- end index (inclusive) of the changefireStepsChanged(int, int)
public void removeListDataListener(javax.swing.event.ListDataListener l)
WizardModel
removeListDataListener
in interface WizardModel
l
- the ListDataListener
to be removedWizardModel.addListDataListener(javax.swing.event.ListDataListener)
public void setSelectedItem(java.lang.Object anItem)
WizardModel
UnsupportedOperationException
.
setSelectedItem
in interface WizardModel
anItem
- the list object to select or null
to clear the selectionpublic boolean supportsLast()
WizardModel
true
if this wizard has the ability to
skip intermediate pages and advance to the last page.
Note that this method ignores the current state of this wizard.
To check if this wizard can jump to the last page given the
current state, use canStepLast
.
JWizard
uses this property to determine if it should
show the Last button.
supportsLast
in interface WizardModel
true
if this wizard has the ability to
skip intermediate pages and advance to the last pageWizardModel.canStepLast()
|
Side of Software Wizard Library 1.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |