Package groovy.swing.model
Class DefaultTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
groovy.swing.model.DefaultTableModel
- All Implemented Interfaces:
Serializable
,TableModel
A default table model made up of PropertyModels on a Value model.
- See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
ConstructorDescriptionDefaultTableModel
(ValueModel rowsModel) DefaultTableModel
(ValueModel rowsModel, ValueModel rowModel) -
Method Summary
Modifier and TypeMethodDescriptionaddClosureColumn
(Object headerValue, Closure readClosure, Closure writeClosure, Class type) Adds a closure based column to the tablevoid
addColumn
(DefaultTableColumn column) Adds a new column definition to the tableaddColumn
(Object headerValue, ValueModel columnValueModel) addColumn
(Object headerValue, Object identifier, ValueModel columnValueModel) addPropertyColumn
(Object headerValue, String property, Class type) Adds a property model column to the tableaddPropertyColumn
(Object headerValue, String property, Class type, boolean editable) Adds a property model column to the tablegetColumnClass
(int columnIndex) int
protected ValueModel
getColumnModel
(int columnIndex) getColumnName
(int columnIndex) int
protected List
getRows()
getValueAt
(int rowIndex, int columnIndex) boolean
isCellEditable
(int rowIndex, int columnIndex) void
removeColumn
(DefaultTableColumn column) Removes a column definition from the tablevoid
setValueAt
(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
-
DefaultTableModel
-
DefaultTableModel
-
-
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:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
-
getColumnClass
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) - Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
-
getValueAt
-
setValueAt
- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractTableModel
-
getColumnModel
-
getRows
-
getRowModel
-
getRowsModel
-