Package groovy.swing.model
Class DefaultTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
groovy.swing.model.DefaultTableModel
- All Implemented Interfaces:
Serializable,TableModel
public class DefaultTableModel extends AbstractTableModel
A default table model made up of PropertyModels on a Value model.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDefaultTableModel.MyTableColumnModel -
Field Summary
-
Constructor Summary
Constructors Constructor Description DefaultTableModel(ValueModel rowsModel)DefaultTableModel(ValueModel rowsModel, ValueModel rowModel) -
Method Summary
Modifier and Type Method Description DefaultTableColumnaddClosureColumn(Object headerValue, Closure readClosure, Closure writeClosure, Class type)Adds a closure based column to the tablevoidaddColumn(DefaultTableColumn column)Adds a new column definition to the tableDefaultTableColumnaddColumn(Object headerValue, ValueModel columnValueModel)DefaultTableColumnaddColumn(Object headerValue, Object identifier, ValueModel columnValueModel)DefaultTableColumnaddPropertyColumn(Object headerValue, String property, Class type)Adds a property model column to the tableDefaultTableColumnaddPropertyColumn(Object headerValue, String property, Class type, boolean editable)Adds a property model column to the tableClassgetColumnClass(int columnIndex)intgetColumnCount()ListgetColumnList()TableColumnModelgetColumnModel()protected ValueModelgetColumnModel(int columnIndex)StringgetColumnName(int columnIndex)intgetRowCount()ValueModelgetRowModel()protected ListgetRows()ValueModelgetRowsModel()ObjectgetValueAt(int rowIndex, int columnIndex)booleanisCellEditable(int rowIndex, int columnIndex)voidremoveColumn(DefaultTableColumn column)Removes a column definition from the tablevoidsetValueAt(Object value, int rowIndex, int columnIndex)Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Constructor Details
-
Method Details
-
getColumnList
- Returns:
- the column definitions.
-
getColumnModel
-
addPropertyColumn
Adds a property model column to the table -
addPropertyColumn
public DefaultTableColumn addPropertyColumn(Object headerValue, String property, Class type, boolean editable)Adds a property model column to the table -
addClosureColumn
public DefaultTableColumn addClosureColumn(Object headerValue, Closure readClosure, Closure writeClosure, Class type)Adds a closure based column to the table -
addColumn
-
addColumn
public DefaultTableColumn addColumn(Object headerValue, Object identifier, ValueModel columnValueModel) -
addColumn
Adds a new column definition to the table -
removeColumn
Removes a column definition from the table -
getRowCount
public int getRowCount() -
getColumnCount
public int getColumnCount() -
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex)- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
getValueAt
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
getColumnModel
-
getRows
-
getRowModel
-
getRowsModel
-