gov.nist.antd.java.swing.table
Class NistTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--javax.swing.table.DefaultTableModel
              |
              +--gov.nist.antd.java.swing.table.NistTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class NistTableModel
extends javax.swing.table.DefaultTableModel

This panel contains the DefaultCellEditor.

 This class was developed at the National Institute of Standards and
 Technology by employees of the Federal Government in the course of
 their official duties. Pursuant to title 17 Section 105 of the United
 States Code this software is not subject to copyright protection and
 is in the public domain.
NIST assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic.
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
borchert
, rouil
See Also:
Serialized Form

Field Summary
protected  boolean editable
          Indicate if the table can be editable
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
NistTableModel(java.util.Vector columnNames, int numRows)
          Constructs a NistTableModel with as many columns as there are elements in columnNames and numRows of null object values.
 
Method Summary
 boolean isCellEditable(int row, int column)
          Returns true if attribute editable is true and not the first column.
 void setEditable(boolean value)
          Allow the user to edit value cells
 
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, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

editable

protected boolean editable
Indicate if the table can be editable

Constructor Detail

NistTableModel

public NistTableModel(java.util.Vector columnNames,
                      int numRows)
Constructs a NistTableModel with as many columns as there are elements in columnNames and numRows of null object values. Each column's name will be taken from the columnNames vector.

Parameters:
columnNames - vector containing the names of the new columns. If this is null then the model has no columns
numRows - the number of rows the table holds
Method Detail

setEditable

public void setEditable(boolean value)
Allow the user to edit value cells

Parameters:
value - The boolean value to set the attribute editable

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Returns true if attribute editable is true and not the first column.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.DefaultTableModel
Parameters:
row - the row whose value is to be queried
column - the column whose value is to be queried
Returns:
false for the first column