|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.bebop.AbstractSingleSelectionModel
A standard implementation of SingleSelectionModel
and Lockable
. Those
wishing to define a SingleSelectionModel will ordinarily want to extend
this class.
Field Summary | |
static String |
versionId
|
Constructor Summary | |
AbstractSingleSelectionModel()
Creates a new AbstractSingleSelectionModel. |
Method Summary | |
void |
addChangeListener(ChangeListener l)
Adds a change listener to the model. |
void |
clearSelection(PageState state)
Clears the selection. |
protected void |
fireStateChanged(PageState state)
|
abstract Object |
getSelectedKey(PageState state)
Returns the key that identifies the selected element. |
boolean |
isLocked()
Return whether an object is locked and thus immutable, or can still be modified. |
boolean |
isSelected(PageState state)
Returns true if there is a selected element. |
void |
lock()
Lock an object. |
void |
removeChangeListener(ChangeListener l)
Removes a change listener from the model. |
abstract void |
setSelectedKey(PageState state,
Object key)
Sets the selected key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.arsdigita.bebop.SingleSelectionModel |
getStateParameter |
Field Detail |
public static final String versionId
Constructor Detail |
public AbstractSingleSelectionModel()
Method Detail |
public boolean isSelected(PageState state)
true
if there is a selected element.
isSelected
in interface SingleSelectionModel
state
- the state of the current request
true
if there is a selected component;
false
otherwise.public abstract Object getSelectedKey(PageState state)
SingleSelectionModel
getSelectedKey
in interface SingleSelectionModel
state
- a PageState
value
String
value.public abstract void setSelectedKey(PageState state, Object key)
SingleSelectionModel
key
is not in the collection of
objects underlying this model, an
IllegalArgumentException
is thrown.
setSelectedKey
in interface SingleSelectionModel
state
- the state of the current requestkey
- the selected keypublic void clearSelection(PageState state)
SingleSelectionModel
clearSelection
in interface SingleSelectionModel
state
- the state of the current requestpublic void addChangeListener(ChangeListener l)
SingleSelectionModel
stateChanged
method is called whenever the selected key changes.
addChangeListener
in interface SingleSelectionModel
l
- a listener to notify when the selected key changespublic void removeChangeListener(ChangeListener l)
SingleSelectionModel
removeChangeListener
in interface SingleSelectionModel
l
- the listener to removeprotected void fireStateChanged(PageState state)
public void lock()
Lockable
setXXX
method
should lead to an exception.
Most lockable Bebop classes throw an IllegalStateException
if an attempt is made to modify a
locked instance.
lock
in interface Lockable
public final boolean isLocked()
Lockable
isLocked
in interface Lockable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |