com.fruitioninc.jwc
Class ThreadLocalListBoxModel

java.lang.Object
  |
  +--com.fruitioninc.jwc.AbstractModel
        |
        +--com.fruitioninc.jwc.AbstractListBoxModel
              |
              +--com.fruitioninc.jwc.ThreadLocalListBoxModel
All Implemented Interfaces:
ListBoxModel, Model

public class ThreadLocalListBoxModel
extends AbstractListBoxModel

A list box model that stores it's state in thread local storage. Note that only the selected indices are stored in thread local storage. The elements are stored in membor variables and thus are global to all threads and requests.


Field Summary
static java.lang.String PROPERTY_SELECTED_INDICES
           
 
Constructor Summary
ThreadLocalListBoxModel(Component component)
           
ThreadLocalListBoxModel(Component component, java.lang.Object[] elements)
           
 
Method Summary
protected  java.lang.Object[] _getElements()
          Returns the elements in this list box.
protected  void _setElements(java.lang.Object[] elements)
          Sets the elements in this list box.
 int[] getSelectedIndices()
          Returns the indices of the elements are are selected.
 void setSelectedIndices(int[] indices)
          Sets the indices of the elements are are selected.
 
Methods inherited from class com.fruitioninc.jwc.AbstractListBoxModel
_getElementAt, _getSize, _setElementAt
 
Methods inherited from class com.fruitioninc.jwc.AbstractModel
_getStatefull, _setStatefull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.fruitioninc.jwc.Model
_getStatefull, _setStatefull
 

Field Detail

PROPERTY_SELECTED_INDICES

public static final java.lang.String PROPERTY_SELECTED_INDICES
See Also:
Constant Field Values
Constructor Detail

ThreadLocalListBoxModel

public ThreadLocalListBoxModel(Component component)

ThreadLocalListBoxModel

public ThreadLocalListBoxModel(Component component,
                               java.lang.Object[] elements)
Method Detail

getSelectedIndices

public int[] getSelectedIndices()
Description copied from class: AbstractListBoxModel
Returns the indices of the elements are are selected.

Specified by:
getSelectedIndices in interface ListBoxModel
Specified by:
getSelectedIndices in class AbstractListBoxModel

setSelectedIndices

public void setSelectedIndices(int[] indices)
Description copied from class: AbstractListBoxModel
Sets the indices of the elements are are selected.

Specified by:
setSelectedIndices in interface ListBoxModel
Specified by:
setSelectedIndices in class AbstractListBoxModel

_getElements

protected java.lang.Object[] _getElements()
Description copied from class: AbstractListBoxModel
Returns the elements in this list box.

Specified by:
_getElements in class AbstractListBoxModel

_setElements

protected void _setElements(java.lang.Object[] elements)
Description copied from class: AbstractListBoxModel
Sets the elements in this list box.

Specified by:
_setElements in class AbstractListBoxModel