echopoint.table
Class TableModelAdapter

java.lang.Object
  extended by nextapp.echo.table.AbstractTableModel
      extended by echopoint.table.TableModelAdapter
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, TableModelListener, TableModel
Direct Known Subclasses:
DefaultPagedTableModel, SortableTableModel

public abstract class TableModelAdapter
extends AbstractTableModel
implements TableModelListener

TableModelAdapter provides most of the common table behavour and can be subclassed by filters that only need to override a handful of specific methods. TableModelAdapter implements TableModel by routing all requests to its model, and TableModelListener by routing all events to its listeners.

See Also:
Serialized Form

Field Summary
protected  TableModel model
           
 
Fields inherited from class nextapp.echo.table.AbstractTableModel
listenerList
 
Constructor Summary
TableModelAdapter()
           
 
Method Summary
 void deleteRow(int row)
          Deletes the specified row.
 java.lang.Class getColumnClass(int aColumn)
          Returns Object.class.
 int getColumnCount()
          Returns the number of columns in the table.
 java.lang.String getColumnName(int aColumn)
          Returns the value found at the given coordinate within the table.
 TableModel getModel()
           
 int getRowCount()
          Returns the number of rows in the table.
 java.lang.Object getValueAt(int col, int row)
          Returns the value found at the given coordinate within the table.
 void insertRow(int row, java.lang.Object[] rowData)
          Inserts a row with the provided data.
 boolean isRowEditable(int row)
           When a table model supports editing of data, this method will be called to query if a row is currently editable.
 void setModel(TableModel model)
           
 void tableChanged(TableModelEvent e)
          Invoked when a table is changed.
 
Methods inherited from class nextapp.echo.table.AbstractTableModel
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected TableModel model
Constructor Detail

TableModelAdapter

public TableModelAdapter()
Method Detail

deleteRow

public void deleteRow(int row)
Deletes the specified row. NOTE : this will only work if the underlying TableModel does in fact have an insertRow method, like DefaultTableModel does.

Parameters:
row - The row to delete.

getColumnClass

public java.lang.Class getColumnClass(int aColumn)
Description copied from class: AbstractTableModel
Returns Object.class.

Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel
Parameters:
aColumn - The column number whose class is to be returned.
Returns:
The most-specific class found in the given table column.
See Also:
TableModel

getColumnCount

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

Specified by:
getColumnCount in interface TableModel
Returns:
The number of columns in the table.
See Also:
TableModel

getColumnName

public java.lang.String getColumnName(int aColumn)
Description copied from class: AbstractTableModel
Returns the value found at the given coordinate within the table. This method returns a column name using the same notation as a spreadsheet (A, B, C ... Y, Z, AA, AB, AC ...)

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
Parameters:
aColumn - The column of the value to return.
Returns:
The name of the specified column number.
See Also:
TableModel

getModel

public TableModel getModel()
See Also:
TableModel

getRowCount

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

Specified by:
getRowCount in interface TableModel
Returns:
The number of rows in the table.
See Also:
TableModel

getValueAt

public java.lang.Object getValueAt(int col,
                                   int row)
Description copied from interface: TableModel
Returns the value found at the given coordinate within the table.

Specified by:
getValueAt in interface TableModel
Parameters:
col - The column of the value to return.
row - The row of the value to return.
See Also:
TableModel

insertRow

public void insertRow(int row,
                      java.lang.Object[] rowData)
Inserts a row with the provided data. NOTE : this will only work if the underlying TableModel does in fact have an insertRow method, like DefaultTableModel does.

Parameters:
row - The index of the inserted row.
rowData - The data for the new.

setModel

public void setModel(TableModel model)
See Also:
TableModel

tableChanged

public void tableChanged(TableModelEvent e)
Description copied from interface: TableModelListener
Invoked when a table is changed.

Specified by:
tableChanged in interface TableModelListener
Parameters:
e - The event describing the action.
See Also:
TableModel

isRowEditable

public boolean isRowEditable(int row)
Description copied from interface: TableModel

When a table model supports editing of data, this method will be called to query if a row is currently editable.

Specified by:
isRowEditable in interface TableModel
Overrides:
isRowEditable in class AbstractTableModel