com.jidesoft.grid
Class DefaultStyleTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
com.jidesoft.grid.DefaultStyleTableModel
- All Implemented Interfaces:
- StyleModel, StyleTableModel, Serializable, TableModel
public class DefaultStyleTableModel
- extends DefaultTableModel
- implements StyleTableModel
DefaultStyleTableModel
adds StyleModel
support to DefaultTableModel
. You can
use it as replacement for DefaultTableModel
. Instead of return a cell style programmatically like in
AbstractStyleTableModel
, you can use setCellStyle(int,int,CellStyle)
or removeCellStyle(int,int)
to control the cell style.
- See Also:
- Serialized Form
Methods inherited from class javax.swing.table.DefaultTableModel |
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, isCellEditable, 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 |
DefaultStyleTableModel
public DefaultStyleTableModel()
DefaultStyleTableModel
public DefaultStyleTableModel(int rowCount,
int columnCount)
DefaultStyleTableModel
public DefaultStyleTableModel(Vector columnNames,
int rowCount)
DefaultStyleTableModel
public DefaultStyleTableModel(Object[] columnNames,
int rowCount)
DefaultStyleTableModel
public DefaultStyleTableModel(Vector data,
Vector columnNames)
DefaultStyleTableModel
public DefaultStyleTableModel(Object[][] data,
Object[] columnNames)
getCellStyleAt
public CellStyle getCellStyleAt(int rowIndex,
int columnIndex)
- Gets the cell style at the specified row and column index.
- Specified by:
getCellStyleAt
in interface StyleModel
- Parameters:
rowIndex
- columnIndex
-
- Returns:
- the cell style at the specified row and column index.
setCellStyle
public void setCellStyle(int rowIndex,
int columnIndex,
CellStyle cellStyle)
- Adds a cell style.
- Parameters:
cellStyle
-
removeCellStyle
public void removeCellStyle(int rowIndex,
int columnIndex)
- Removes the cell style.
- Parameters:
rowIndex
- columnIndex
-
removeAllCellStyles
public void removeAllCellStyles()
- Removes all cell styles. TableDataChanged event will be fired if there were cell styles set before.
Note: If you want to turn of all cell styles temporarily, you should use
setCellStyleOn(false)
.
isCellStyleOn
public boolean isCellStyleOn()
- Description copied from interface:
StyleModel
- Checks if the style is on. The CellStyleTable will ignore all the CellStyles defined in this model if this method
returns false.
- Specified by:
isCellStyleOn
in interface StyleModel
- Returns:
- true if style is on. Otherwise false.
setCellStyleOn
public void setCellStyleOn(boolean cellStyleOn)