com.algosome.common.event
Class IndexSelectionModelImpl

java.lang.Object
  extended by com.algosome.common.event.IndexSelectionModelImpl
All Implemented Interfaces:
IndexSelectionModel

public class IndexSelectionModelImpl
extends java.lang.Object
implements IndexSelectionModel

Implementation of the IndexSelectionModel interface. Defaults to single selection mode

Author:
Greg Cope

Field Summary
 
Fields inherited from interface com.algosome.common.event.IndexSelectionModel
MULTI_SELECTION_MODE, SINGLE_SELECTION_MODE
 
Constructor Summary
IndexSelectionModelImpl()
           
 
Method Summary
 void addSelectionListener(IndexSelectionListener listener)
          Adds the parameter listener
 java.util.List<IndexSelectionListener> getListeners()
          Retrieves all Listeners.
 int[] getSelectedIndeces()
          Retrieves the selected indeces, or {-1}.
 int getSelectedIndex()
          Retrieves the selected index.
 int getSelectionMode()
          Retrieves the mode.
 void removeSelectionListener(IndexSelectionListener listener)
          Removes the parameter listener.
 void setSelection(int... sel)
          Sets the selection.
 void setSelectionMode(int mode)
          Sets the mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexSelectionModelImpl

public IndexSelectionModelImpl()
Method Detail

addSelectionListener

public void addSelectionListener(IndexSelectionListener listener)
Description copied from interface: IndexSelectionModel
Adds the parameter listener

Specified by:
addSelectionListener in interface IndexSelectionModel

getSelectedIndeces

public int[] getSelectedIndeces()
Description copied from interface: IndexSelectionModel
Retrieves the selected indeces, or {-1}.

Specified by:
getSelectedIndeces in interface IndexSelectionModel
Returns:

getSelectedIndex

public int getSelectedIndex()
Description copied from interface: IndexSelectionModel
Retrieves the selected index. If selection mode is MULTI_SELECTION_MODE, this retrieves the first value of the list. If no selection is available, -1 should be returned.

Specified by:
getSelectedIndex in interface IndexSelectionModel
Returns:

getSelectionMode

public int getSelectionMode()
Description copied from interface: IndexSelectionModel
Retrieves the mode.

Specified by:
getSelectionMode in interface IndexSelectionModel
Returns:
One of SINGLE_SELECTION_MODE or MULTI_SELECTION_MODE

removeSelectionListener

public void removeSelectionListener(IndexSelectionListener listener)
Description copied from interface: IndexSelectionModel
Removes the parameter listener.

Specified by:
removeSelectionListener in interface IndexSelectionModel

setSelection

public void setSelection(int... sel)
Description copied from interface: IndexSelectionModel
Sets the selection.

Specified by:
setSelection in interface IndexSelectionModel

setSelectionMode

public void setSelectionMode(int mode)
Description copied from interface: IndexSelectionModel
Sets the mode.

Specified by:
setSelectionMode in interface IndexSelectionModel
Parameters:
mode - On of SINGLE_SELECTION_MODE or MULTI_SELECTION_MODE

getListeners

public java.util.List<IndexSelectionListener> getListeners()
Description copied from interface: IndexSelectionModel
Retrieves all Listeners.

Specified by:
getListeners in interface IndexSelectionModel
Returns: