com.metamatrix.toolbox.ui.widget.table
Class DefaultTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by javax.swing.table.DefaultTableModel
          extended by com.metamatrix.toolbox.ui.widget.table.DefaultTableModel
All Implemented Interfaces:
EnhancedTableModel, java.io.Serializable, javax.swing.table.TableModel
Direct Known Subclasses:
EntitlementsTableModel, ExtensionSourcesTableModel, GroupsAccumulatorPanel.GroupsTableModel, QueryTableModel, SessionTableModel, TransactionTableModel

public class DefaultTableModel
extends javax.swing.table.DefaultTableModel
implements EnhancedTableModel

This is the default implementation of EnhancedTableModel used by a TableWidget when the TableModel is not passed in the constructor.

Since:
2.0
Version:
2.0
Author:
John P. A. Verhaeg
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
DefaultTableModel()
           
DefaultTableModel(int rowCount, int columnCount)
           
DefaultTableModel(java.lang.Object[][] data, java.lang.Object[] columnNames)
           
DefaultTableModel(java.util.Vector columnNames)
           
DefaultTableModel(java.util.Vector columnNames, int rowCount)
           
DefaultTableModel(java.util.Vector data, java.util.Vector columnNames)
           
 
Method Summary
 void addColumn(java.lang.Object columnName, java.util.Vector columnData)
          Overridden to add an entry to the column edit status list.
protected  void addColumnEditStatus()
          Adds an entry to the column edit status list.
protected  void createColumnEditStatusList()
          Creates the column edit status list if necessary.
protected  void initializeDefaultTableModel()
          Creates column edit status list.
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 boolean isColumnEditable(int columnIndex)
           
 boolean isEditable()
           
 boolean isRowEditable(int rowIndex)
           
 void setCellEditable(int rowIndex, int columnIndex, boolean isCellEditable)
          Sets the specified cell to the specified editability.
 void setColumnEditable(int columnIndex, boolean isEditable)
          Sets all cells within the specified column to the specified editability.
protected  void setColumnEditStatusList(java.util.Vector columnNames)
           
 void setColumnIdentifiers(java.util.Vector columnNames)
          Overridden to add entries to the column edit status list if the specified number of columnNames is greater than the current number of column edit status entries.
 void setDataVector(java.util.Vector data, java.util.Vector columnNames)
          Overridden to force firing of deletion event before insertion event.
 void setEditable(boolean isEditable)
          Sets all cells within the model to the specified editability.
 void setRowEditable(int rowIndex, boolean isEditable)
          Sets all cells within the specified row to the specified editability.
 void setValueAt(java.lang.Object value, int rowIndex, int columnIndex)
           
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setDataVector, setNumRows, setRowCount
 
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
 
Methods inherited from interface com.metamatrix.toolbox.ui.widget.table.EnhancedTableModel
getDataVector
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, removeTableModelListener
 

Constructor Detail

DefaultTableModel

public DefaultTableModel()
Since:
2.0

DefaultTableModel

public DefaultTableModel(java.util.Vector columnNames)
Since:
2.0

DefaultTableModel

public DefaultTableModel(int rowCount,
                         int columnCount)
Since:
2.0

DefaultTableModel

public DefaultTableModel(java.util.Vector columnNames,
                         int rowCount)
Since:
2.0

DefaultTableModel

public DefaultTableModel(java.util.Vector data,
                         java.util.Vector columnNames)
Since:
2.0

DefaultTableModel

public DefaultTableModel(java.lang.Object[][] data,
                         java.lang.Object[] columnNames)
Since:
2.0
Method Detail

addColumn

public void addColumn(java.lang.Object columnName,
                      java.util.Vector columnData)
Overridden to add an entry to the column edit status list.

Overrides:
addColumn in class javax.swing.table.DefaultTableModel
Since:
2.0

addColumnEditStatus

protected void addColumnEditStatus()
Adds an entry to the column edit status list.

Since:
2.0

createColumnEditStatusList

protected void createColumnEditStatusList()
Creates the column edit status list if necessary.

Since:
2.0

initializeDefaultTableModel

protected void initializeDefaultTableModel()
Creates column edit status list.

Since:
2.0

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.DefaultTableModel
Parameters:
rowIndex - The cell's row index
columnIndex - The cell's column index
Returns:
True if the cell at the specified row and column index is editable.
Since:
2.0

isColumnEditable

public boolean isColumnEditable(int columnIndex)
Specified by:
isColumnEditable in interface EnhancedTableModel
Parameters:
columnIndex - The column's index
Returns:
True if any cell in the specified column is editable
Since:
2.0

isEditable

public boolean isEditable()
Specified by:
isEditable in interface EnhancedTableModel
Returns:
True if any cell within the model is editable.
Since:
2.0

isRowEditable

public boolean isRowEditable(int rowIndex)
Specified by:
isRowEditable in interface EnhancedTableModel
Parameters:
rowIndex - The cell's row index
Returns:
True if any cell in the specified row is editable
Since:
2.0

setCellEditable

public void setCellEditable(int rowIndex,
                            int columnIndex,
                            boolean isCellEditable)
Sets the specified cell to the specified editability.

Specified by:
setCellEditable in interface EnhancedTableModel
Parameters:
rowIndex - The cell's row index
columnIndex - The cell's column index
isEditable - True if the cell is to be set to editable
Since:
2.0

setColumnEditable

public void setColumnEditable(int columnIndex,
                              boolean isEditable)
Sets all cells within the specified column to the specified editability.

Specified by:
setColumnEditable in interface EnhancedTableModel
Parameters:
columnIndex - The column's index
isEditable - True if the column's cells are to be set to editable
Since:
2.0

setColumnEditStatusList

protected void setColumnEditStatusList(java.util.Vector columnNames)
Since:
2.1

setColumnIdentifiers

public void setColumnIdentifiers(java.util.Vector columnNames)
Overridden to add entries to the column edit status list if the specified number of columnNames is greater than the current number of column edit status entries.

Specified by:
setColumnIdentifiers in interface EnhancedTableModel
Overrides:
setColumnIdentifiers in class javax.swing.table.DefaultTableModel
Since:
2.0

setDataVector

public void setDataVector(java.util.Vector data,
                          java.util.Vector columnNames)
Overridden to force firing of deletion event before insertion event.

Overrides:
setDataVector in class javax.swing.table.DefaultTableModel
Since:
2.0

setEditable

public void setEditable(boolean isEditable)
Sets all cells within the model to the specified editability.

Specified by:
setEditable in interface EnhancedTableModel
Parameters:
isEditable - True if the cells are to be set to editable
Since:
2.0

setRowEditable

public void setRowEditable(int rowIndex,
                           boolean isEditable)
Sets all cells within the specified row to the specified editability.

Specified by:
setRowEditable in interface EnhancedTableModel
Parameters:
rowIndex - The row's index
isEditable - True if the row's cells are to be set to editable
Since:
2.0

setValueAt

public void setValueAt(java.lang.Object value,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.DefaultTableModel


Copyright © 2009. All Rights Reserved.