NextApp Echo2
v2.1.0

nextapp.echo2.app.list
Class DefaultListSelectionModel

java.lang.Object
  extended by nextapp.echo2.app.list.DefaultListSelectionModel
All Implemented Interfaces:
java.io.Serializable, ListSelectionModel

public class DefaultListSelectionModel
extends java.lang.Object
implements ListSelectionModel, java.io.Serializable

Default ListSelectionModel implementation.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface nextapp.echo2.app.list.ListSelectionModel
MULTIPLE_SELECTION, SINGLE_SELECTION
 
Constructor Summary
DefaultListSelectionModel()
           
 
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.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultListSelectionModel

public DefaultListSelectionModel()
Method Detail

addChangeListener

public void addChangeListener(ChangeListener l)
Description copied from interface: ListSelectionModel
Adds a ChangeListenerb to the selection model, which will be notified when the selection changes.

Specified by:
addChangeListener in interface ListSelectionModel
Parameters:
l - the ChangeListener to add
See Also:
ListSelectionModel.addChangeListener( nextapp.echo2.app.event.ChangeListener)

clearSelection

public void clearSelection()
Description copied from interface: ListSelectionModel
Deselects all items.

Specified by:
clearSelection in interface ListSelectionModel
See Also:
ListSelectionModel.clearSelection()

fireValueChanged

protected void fireValueChanged()
Notifies ChangeListeners that the selection has changed.


getMaxSelectedIndex

public int getMaxSelectedIndex()
Description copied from interface: ListSelectionModel
Returns the maximum selected index. Returns -1 when no items are selected.

Specified by:
getMaxSelectedIndex in interface ListSelectionModel
Returns:
the maximum selected index
See Also:
ListSelectionModel.getMaxSelectedIndex()

getMinSelectedIndex

public int getMinSelectedIndex()
Description copied from interface: ListSelectionModel
Returns the minimum selected index. Returns -1 when no items are selected.

Specified by:
getMinSelectedIndex in interface ListSelectionModel
Returns:
the minimum selected index
See Also:
ListSelectionModel.getMinSelectedIndex()

getSelectionMode

public int getSelectionMode()
Description copied from interface: ListSelectionModel
Returns the selection mode.

Specified by:
getSelectionMode in interface ListSelectionModel
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.
See Also:
ListSelectionModel.getSelectionMode()

isSelectedIndex

public boolean isSelectedIndex(int index)
Description copied from interface: ListSelectionModel
Determines whether an index is selected.

Specified by:
isSelectedIndex in interface ListSelectionModel
Parameters:
index - the index
Returns:
true if the index is selected
See Also:
ListSelectionModel.isSelectedIndex(int)

isSelectionEmpty

public boolean isSelectionEmpty()
Description copied from interface: ListSelectionModel
Determines if no items are selected.

Specified by:
isSelectionEmpty in interface ListSelectionModel
Returns:
true if no items are selected
See Also:
ListSelectionModel.isSelectionEmpty()

removeChangeListener

public void removeChangeListener(ChangeListener l)
Description copied from interface: ListSelectionModel
Removes a ChangeListener from being notified of when the selection changes.

Specified by:
removeChangeListener in interface ListSelectionModel
Parameters:
l - the ChangeListener to remove
See Also:
ListSelectionModel.removeChangeListener(nextapp.echo2.app.event.ChangeListener)

setSelectedIndex

public void setSelectedIndex(int index,
                             boolean newValue)
Description copied from interface: ListSelectionModel
Sets the selection state of the given index.

Specified by:
setSelectedIndex in interface ListSelectionModel
Parameters:
index - the index
newValue - the new selection state
See Also:
ListSelectionModel.setSelectedIndex(int, boolean)

setSelectionMode

public void setSelectionMode(int selectionMode)
Description copied from interface: ListSelectionModel
Sets the selection mode.

Specified by:
setSelectionMode in interface ListSelectionModel
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.
See Also:
ListSelectionModel.setSelectionMode(int)

NextApp Echo2
v2.1.0