org.jdesktop.swing.table
Class DefaultTableModelExt

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byjavax.swing.table.DefaultTableModel
          extended byorg.jdesktop.swing.table.DefaultTableModelExt
All Implemented Interfaces:
Serializable, TableModel

public class DefaultTableModelExt
extends DefaultTableModel

Adds metadata support to table model.

See Also:
Serialized Form

Field Summary
protected  Object metadata
           
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
DefaultTableModelExt()
           
DefaultTableModelExt(int rowCount, int columnCount)
           
DefaultTableModelExt(Object[][] data, Object[] columnNames)
           
DefaultTableModelExt(Object[] columnNames, int rowCount)
           
DefaultTableModelExt(Vector columnNames, int rowCount)
           
DefaultTableModelExt(Vector data, Vector columnNames)
           
 
Method Summary
 Class getColumnClass(int columnIndex)
           
 Object getMetadata()
          Temporary placeholder.
protected  Class inferColumnClass(int columnIndex)
          Infers column class from the object in the specified column of the first row.
 boolean isCellEditable(int row, int columnIndex)
          Determines if the specified cell is editable or not.
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metadata

protected Object metadata
Constructor Detail

DefaultTableModelExt

public DefaultTableModelExt()

DefaultTableModelExt

public DefaultTableModelExt(int rowCount,
                            int columnCount)

DefaultTableModelExt

public DefaultTableModelExt(Vector columnNames,
                            int rowCount)

DefaultTableModelExt

public DefaultTableModelExt(Object[] columnNames,
                            int rowCount)

DefaultTableModelExt

public DefaultTableModelExt(Vector data,
                            Vector columnNames)

DefaultTableModelExt

public DefaultTableModelExt(Object[][] data,
                            Object[] columnNames)
Method Detail

getColumnClass

public Class getColumnClass(int columnIndex)

inferColumnClass

protected Class inferColumnClass(int columnIndex)
Infers column class from the object in the specified column of the first row. If that cell is empty, this method returns Object.class as the column class.

Parameters:
columnIndex - zero-based index of a table column
Returns:
the class of the object in the specified column of the first row, or Object.class if the cell is empty

isCellEditable

public boolean isCellEditable(int row,
                              int columnIndex)
Determines if the specified cell is editable or not. Returns false if it can determine that the entire specified column is uneditable. Otherwise, it defers the decision to the superclass.

Parameters:
row - zero-based row index
columnIndex - zero-based column index
Returns:
true if the cell is editable; false otherwise

getMetadata

public Object getMetadata()
Temporary placeholder. Integrate with real metadata support.



Copyright 2004 by Sun Microsystems, Inc. All Rights Reserved.