public class DefaultListSelectionModel extends java.lang.Object implements ListSelectionModel, java.io.Serializable
ListSelectionModel implementation.MULTIPLE_SELECTION, SINGLE_SELECTION| Constructor and Description |
|---|
DefaultListSelectionModel() |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(ChangeListener l)
Adds a
ChangeListenerb to the selection model, which will
be notified when the selection changes. |
void |
clearSelection()
Deselects all items.
|
protected void |
fireValueChanged()
Notifies
ChangeListeners that the selection has
changed. |
int |
getMaxSelectedIndex()
Returns the maximum selected index.
|
int |
getMinSelectedIndex()
Returns the minimum selected index.
|
int |
getSelectionMode()
Returns the selection mode.
|
boolean |
isSelectedIndex(int index)
Determines whether an index is selected.
|
boolean |
isSelectionEmpty()
Determines if no items are selected.
|
void |
removeChangeListener(ChangeListener l)
Removes a
ChangeListener from being notified of when the
selection changes. |
void |
setSelectedIndex(int index,
boolean newValue)
Sets the selection state of the given index.
|
void |
setSelectionMode(int selectionMode)
Sets the selection mode.
|
public void addChangeListener(ChangeListener l)
ListSelectionModelChangeListenerb to the selection model, which will
be notified when the selection changes.addChangeListener in interface ListSelectionModell - the ChangeListener to addListSelectionModel.addChangeListener(
nextapp.echo.app.event.ChangeListener)public void clearSelection()
ListSelectionModelclearSelection in interface ListSelectionModelListSelectionModel.clearSelection()protected void fireValueChanged()
ChangeListeners that the selection has
changed.public int getMaxSelectedIndex()
ListSelectionModelgetMaxSelectedIndex in interface ListSelectionModelListSelectionModel.getMaxSelectedIndex()public int getMinSelectedIndex()
ListSelectionModelgetMinSelectedIndex in interface ListSelectionModelListSelectionModel.getMinSelectedIndex()public int getSelectionMode()
ListSelectionModelgetSelectionMode in interface ListSelectionModelListSelectionModel.SINGLE_SELECTION: only
one list element may be selected.ListSelectionModel.MULTIPLE_SELECTION:
multiple list elements may be selected.ListSelectionModel.getSelectionMode()public boolean isSelectedIndex(int index)
ListSelectionModelisSelectedIndex in interface ListSelectionModelindex - the indexListSelectionModel.isSelectedIndex(int)public boolean isSelectionEmpty()
ListSelectionModelisSelectionEmpty in interface ListSelectionModelListSelectionModel.isSelectionEmpty()public void removeChangeListener(ChangeListener l)
ListSelectionModelChangeListener from being notified of when the
selection changes.removeChangeListener in interface ListSelectionModell - the ChangeListener to removeListSelectionModel.removeChangeListener(nextapp.echo.app.event.ChangeListener)public void setSelectedIndex(int index,
boolean newValue)
ListSelectionModelsetSelectedIndex in interface ListSelectionModelindex - the indexnewValue - the new selection stateListSelectionModel.setSelectedIndex(int, boolean)public void setSelectionMode(int selectionMode)
ListSelectionModelsetSelectionMode in interface ListSelectionModelselectionMode - the selection mode, one of the following values:
ListSelectionModel.SINGLE_SELECTION: only one list element
may be selected.ListSelectionModel.MULTIPLE_SELECTION: multiple list elements
may be selected.ListSelectionModel.setSelectionMode(int)