|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectechopoint.model.DefaultSingleSelectionModel
public class 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 ChangeEvent |
changeEvent
Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property. |
protected EventListenerList |
listenerList
|
| Constructor Summary | |
|---|---|
DefaultSingleSelectionModel()
Initializes selectedIndex to -1 |
|
DefaultSingleSelectionModel(int index)
Initializes selectedIndex to index |
|
| Method Summary | |
|---|---|
void |
addChangeListener(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(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 ChangeEvent changeEvent
protected EventListenerList listenerList
| Constructor Detail |
|---|
public DefaultSingleSelectionModel()
-1
public DefaultSingleSelectionModel(int index)
| Method Detail |
|---|
public void addChangeListener(ChangeListener l)
SingleSelectionModel
addChangeListener in interface SingleSelectionModell - the ChangeListener to addSingleSelectionModel.addChangeListener(nextapp.echo.event.ChangeListener)public void clearSelection()
SingleSelectionModel
clearSelection in interface SingleSelectionModelSingleSelectionModel.clearSelection()public void fireStateChanged()
public int getSelectedIndex()
SingleSelectionModel
getSelectedIndex in interface SingleSelectionModelSingleSelectionModel.getSelectedIndex()public boolean isSelected()
SingleSelectionModel
isSelected in interface SingleSelectionModelSingleSelectionModel.isSelected()public void removeChangeListener(ChangeListener l)
SingleSelectionModel
removeChangeListener in interface SingleSelectionModell - the ChangeListener to removeSingleSelectionModel.removeChangeListener(nextapp.echo.event.ChangeListener)public void setSelectedIndex(int index)
SingleSelectionModel
setSelectedIndex in interface SingleSelectionModelSingleSelectionModel.setSelectedIndex(int)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||