wt.clients.beans.table
Class WTAbstractTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended bywt.clients.beans.table.WTAbstractTableModel
All Implemented Interfaces:
Serializable, TableModel
Direct Known Subclasses:
WTTableModel.GroupTableModel, WTTableModel.TableRowModel

public abstract class WTAbstractTableModel
extends AbstractTableModel

This class add the support of a table column model to the AbstractTableModel. The support of the data is not provided and should be implementyed in a subclass.

See Also:
Serialized Form

Field Summary
private  TableColumnModel tableColumnModel
          The model managing the table columns
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
WTAbstractTableModel()
          Construct a new WTAbstractTableModel
 
Method Summary
 void addColumn(TableColumn pColumn)
          Add pColumn to the list of columns displayed.
 void addColumns(Enumeration pColumnList)
          Add all the columns of the pColumnList to the list of columns displayed.
 TableColumn getColumn(int columnIndex)
          Returns the column at columnIndex.
 Class getColumnClass(int columnIndex)
          Returns the lowest common denominator Class in the column.
 int getColumnCount()
          Returns the number of columns managed by the data source object.
 String getColumnName(int columnIndex)
          Returns the name of the column at columnIndex.
 Enumeration getColumns()
          Answer the complete list of table columns used in the model.
 Vector getHeaderKeys()
          Deprecated.  
 Vector getHeaders()
          Deprecated.  
 Enumeration getHeaderSizes()
          Deprecated.  
 TableColumnModel getTableColumnModel()
          Answer the current model used for managing the column.
 void removeColumn(TableColumn pColumn)
          Remove pColumn from the list of columns displayed.
 void setTableColumnModel(TableColumnModel pTableColumnModel)
          Set the model managing the columns
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.table.TableModel
getRowCount, getValueAt
 

Field Detail

tableColumnModel

private TableColumnModel tableColumnModel
The model managing the table columns

Constructor Detail

WTAbstractTableModel

public WTAbstractTableModel()
Construct a new WTAbstractTableModel

Method Detail

setTableColumnModel

public void setTableColumnModel(TableColumnModel pTableColumnModel)
Set the model managing the columns

Parameters:
pTableColumnModel -

getTableColumnModel

public TableColumnModel getTableColumnModel()
Answer the current model used for managing the column.

Returns:
TableColumnModel the model in use

addColumns

public void addColumns(Enumeration pColumnList)
Add all the columns of the pColumnList to the list of columns displayed.

Parameters:
pColumnList - an enumeration of columns to add

addColumn

public void addColumn(TableColumn pColumn)
Add pColumn to the list of columns displayed.

Parameters:
pColumn - the column to add

removeColumn

public void removeColumn(TableColumn pColumn)
Remove pColumn from the list of columns displayed.

Parameters:
pColumn - the column to remove

getColumns

public Enumeration getColumns()
Answer the complete list of table columns used in the model.

Returns:
Enumeration an enumeration of TableColumn.

getColumnCount

public int getColumnCount()
Returns the number of columns managed by the data source object. A JTable uses this method to determine how many columns it should create and display on initialization.

Returns:
the number or columns in the model
See Also:
TableModel.getRowCount()

getColumn

public TableColumn getColumn(int columnIndex)
Returns the column at columnIndex.

Parameters:
columnIndex - the index of column
Returns:
the column

getColumnName

public String getColumnName(int columnIndex)
Returns the name of the column at columnIndex. This is used to initialize the table's column header name. Note, this name does not need to be unique. Two columns on a table can have the same name.

Parameters:
columnIndex - the index of column
Returns:
the name of the column

getColumnClass

public Class getColumnClass(int columnIndex)
Returns the lowest common denominator Class in the column. This is used by the table to set up a default renderer and editor for the column.

Returns:
the common ancestor class of the object values in the model.

getHeaders

public Vector getHeaders()
Deprecated.  

Answer the column headers for the table

Returns:
Vector vector of column headers

getHeaderKeys

public Vector getHeaderKeys()
Deprecated.  

Returns:
Vector

getHeaderSizes

public Enumeration getHeaderSizes()
Deprecated.  

Returns:
Enumeration