rand.asset_forfeiture
Class WageTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by javax.swing.table.DefaultTableModel
          extended by rand.asset_forfeiture.WageTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class WageTableModel
extends javax.swing.table.DefaultTableModel

We need an enhancement to the DefaultTableModel in order to properly render combo boxes in individual cells as well as prevent the user from editing the output cells.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
WageTableModel(java.lang.Object[] colNames)
          You only get one constructor, and it just calls its super.
 
Method Summary
 java.lang.Class getColumnClass(int column)
          Overriding the regular getColumnClass method so that not everything is rendered as a String (I want my checkboxes!).
 boolean isCellEditable(int row, int column)
          Overriding the default, which is always true, since the user should not be allowed to edit the output cells.
 void pack(javax.swing.JTable table)
          This over rides the original pack in order to auto-size the column widths properly so all column names are readable.
 
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
 

Constructor Detail

WageTableModel

public WageTableModel(java.lang.Object[] colNames)
You only get one constructor, and it just calls its super. \param colNames and Object array that should just hold the names of each column in order you want them displayed. It is assumed that all the output cells are after all the input cells.

Method Detail

pack

public void pack(javax.swing.JTable table)
This over rides the original pack in order to auto-size the column widths properly so all column names are readable. \param table the JTable that needs to be packed.


getColumnClass

public java.lang.Class getColumnClass(int column)
Overriding the regular getColumnClass method so that not everything is rendered as a String (I want my checkboxes!). \param column the integer for which column you want class information about. \returns the Class object describing what type of data the indicated column holds.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Overriding the default, which is always true, since the user should not be allowed to edit the output cells. \param row the row of the cell in question \param column the column of the cell in question \returns false if the cell is not editable; true if it is

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.DefaultTableModel