com.fruitioninc.jwc
Class ThreadLocalTableModel

java.lang.Object
  |
  +--com.fruitioninc.jwc.AbstractModel
        |
        +--com.fruitioninc.jwc.AbstractTableModel
              |
              +--com.fruitioninc.jwc.ThreadLocalTableModel
All Implemented Interfaces:
Model, TableModel

public class ThreadLocalTableModel
extends AbstractTableModel

A table model that stores it's state in thread local storage. Note that only editable cells are stored in thread local storage. The column names and non-editable cells are stored in member variables and are thus global to all threads and requests


Nested Class Summary
static interface ThreadLocalTableModel.DefaultDataFactory
          Creator of default data.
 
Field Summary
static java.lang.String PROPERTY_DATA
           
 
Constructor Summary
ThreadLocalTableModel(Component component, java.lang.String[] columnNames, ThreadLocalTableModel.DefaultDataFactory defaultDataFactory)
           
 
Method Summary
 java.lang.Class getColumnClass(int column)
          Returns the type of data in the column of a given index.
 int getColumnCount()
          Returns the number of columns in the table.
 java.lang.String getColumnName(int column)
          Returns the name of the column of a given index.
 java.lang.String getColumnTitle(int column)
          Returns title of the column of a given index.
protected  java.lang.Object[][] getData()
           
 int getRowCount()
          Returns the number of rows in the table.
 java.lang.Object getValueAt(int row, int column)
          Returns value of the cell in the given row and column.
 boolean isEditable(int row, int column)
          Returns true if the cell is editable.
 void setValueAt(int row, int column, java.lang.Object value)
          Sets the value of the cell in the given row and column.
 
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_DATA

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

ThreadLocalTableModel

public ThreadLocalTableModel(Component component,
                             java.lang.String[] columnNames,
                             ThreadLocalTableModel.DefaultDataFactory defaultDataFactory)
Method Detail

getColumnCount

public int getColumnCount()
Description copied from interface: TableModel
Returns the number of columns in the table.


getColumnName

public java.lang.String getColumnName(int column)
Description copied from interface: TableModel
Returns the name of the column of a given index.


getColumnTitle

public java.lang.String getColumnTitle(int column)
Description copied from interface: TableModel
Returns title of the column of a given index. This is the text displayed in the column's header.


getColumnClass

public java.lang.Class getColumnClass(int column)
Description copied from interface: TableModel
Returns the type of data in the column of a given index.


getRowCount

public int getRowCount()
Description copied from interface: TableModel
Returns the number of rows in the table.


getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Description copied from interface: TableModel
Returns value of the cell in the given row and column.


setValueAt

public void setValueAt(int row,
                       int column,
                       java.lang.Object value)
Description copied from interface: TableModel
Sets the value of the cell in the given row and column.


isEditable

public boolean isEditable(int row,
                          int column)
Description copied from interface: TableModel
Returns true if the cell is editable.


getData

protected java.lang.Object[][] getData()