|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object echopoint.model.DefaultSingleSelectionModel
A generic implementation of SingleSelectionModel.
This class will perform an optimisation check when the selected index is set and will only fire a ChangeEvent if the index actually changes from the previous value.
Field Summary | |
protected nextapp.echo.event.ChangeEvent |
changeEvent
Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property. |
protected nextapp.echo.event.EventListenerList |
listenerList
|
Constructor Summary | |
DefaultSingleSelectionModel()
Initializes selectedIndex to -1 |
|
DefaultSingleSelectionModel(int index)
Initializes selectedIndex to index |
Method Summary | |
void |
addChangeListener(nextapp.echo.event.ChangeListener l)
Adds listener as a listener to changes in the model. |
void |
clearSelection()
Clears the selection (to -1). |
void |
fireStateChanged()
Notifies all listeners that have registered for this event type. |
int |
getSelectedIndex()
Returns the model's selection. |
boolean |
isSelected()
Returns true if the selection model currently has a selected value. |
void |
removeChangeListener(nextapp.echo.event.ChangeListener l)
Removes listener as a listener to changes in the model. |
void |
setSelectedIndex(int index)
Sets the model's selected index to index. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient nextapp.echo.event.ChangeEvent changeEvent
protected nextapp.echo.event.EventListenerList listenerList
Constructor Detail |
public DefaultSingleSelectionModel()
-1
public DefaultSingleSelectionModel(int index)
Method Detail |
public void addChangeListener(nextapp.echo.event.ChangeListener l)
SingleSelectionModel
addChangeListener
in interface SingleSelectionModel
l
- the ChangeListener to addSingleSelectionModel.addChangeListener(nextapp.echo.event.ChangeListener)
public void clearSelection()
SingleSelectionModel
clearSelection
in interface SingleSelectionModel
SingleSelectionModel.clearSelection()
public void fireStateChanged()
public int getSelectedIndex()
SingleSelectionModel
getSelectedIndex
in interface SingleSelectionModel
SingleSelectionModel.getSelectedIndex()
public boolean isSelected()
SingleSelectionModel
isSelected
in interface SingleSelectionModel
SingleSelectionModel.isSelected()
public void removeChangeListener(nextapp.echo.event.ChangeListener l)
SingleSelectionModel
removeChangeListener
in interface SingleSelectionModel
l
- the ChangeListener to removeSingleSelectionModel.removeChangeListener(nextapp.echo.event.ChangeListener)
public void setSelectedIndex(int index)
SingleSelectionModel
setSelectedIndex
in interface SingleSelectionModel
SingleSelectionModel.setSelectedIndex(int)
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |