NextApp Echo3
v3.0.b4

nextapp.echo.app.list
Interface ListSelectionModel

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
DefaultListSelectionModel

public interface ListSelectionModel
extends java.io.Serializable

A representation of the selected items in a list component.


Field Summary
static int MULTIPLE_SELECTION
           
static int SINGLE_SELECTION
           
 
Method Summary
 void addChangeListener(ChangeListener l)
          Adds a ChangeListenerb to the selection model, which will be notified when the selection changes.
 void clearSelection()
          Deselects all items.
 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 selected)
          Sets the selection state of the given index.
 void setSelectionMode(int selectionMode)
          Sets the selection mode.
 

Field Detail

SINGLE_SELECTION

static final int SINGLE_SELECTION
See Also:
Constant Field Values

MULTIPLE_SELECTION

static final int MULTIPLE_SELECTION
See Also:
Constant Field Values
Method Detail

addChangeListener

void addChangeListener(ChangeListener l)
Adds a ChangeListenerb to the selection model, which will be notified when the selection changes.

Parameters:
l - the ChangeListener to add

clearSelection

void clearSelection()
Deselects all items.


getMaxSelectedIndex

int getMaxSelectedIndex()
Returns the maximum selected index. Returns -1 when no items are selected.

Returns:
the maximum selected index

getMinSelectedIndex

int getMinSelectedIndex()
Returns the minimum selected index. Returns -1 when no items are selected.

Returns:
the minimum selected index

getSelectionMode

int getSelectionMode()
Returns the selection mode.

Returns:
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.

isSelectedIndex

boolean isSelectedIndex(int index)
Determines whether an index is selected.

Parameters:
index - the index
Returns:
true if the index is selected

isSelectionEmpty

boolean isSelectionEmpty()
Determines if no items are selected.

Returns:
true if no items are selected

removeChangeListener

void removeChangeListener(ChangeListener l)
Removes a ChangeListener from being notified of when the selection changes.

Parameters:
l - the ChangeListener to remove

setSelectedIndex

void setSelectedIndex(int index,
                      boolean selected)
Sets the selection state of the given index.

Parameters:
index - the index
selected - the new selection state

setSelectionMode

void setSelectionMode(int selectionMode)
Sets the selection mode.

Parameters:
selectionMode - 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.

NextApp Echo3
v3.0.b4