Class SwingTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
com.jformdesigner.model.SwingTableModel
- All Implemented Interfaces:
Serializable, TableModel
Used for TableModels in JFormDesigner forms.
Extends
DefaultTableModel by the possibility to specify
column types and column editable flags.- See Also:
-
Field Summary
Fields inherited from class DefaultTableModel
columnIdentifiers, dataVectorFields inherited from class AbstractTableModel
listenerList -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a defaultSwingTableModelthat has zero columns and rows.SwingTableModel(SwingTableModel model) Copy constructor.SwingTableModel(Object[][] data, Object[] columnNames) Constructs aSwingTableModeland initializes it with the specified data and column names.SwingTableModel(Vector<? extends Vector> data, Vector<String> columnNames) Constructs aSwingTableModeland initializes it with the specified data and column names.SwingTableModel(Vector<? extends Vector> data, Vector<String> columnNames, Vector<Class<?>> columnTypes, Vector<Boolean> columnEditables) Constructs aSwingTableModeland initializes it with the specified data, column names, column types and column editable flags.SwingTableModel(Vector<? extends Vector> data, Vector<String> columnNames, Vector<Class<?>> columnTypes, Vector<Boolean> columnEditables, Vector<SwingTableColumn> columnInfos) Constructs aSwingTableModeland initializes it with the specified data, column names, column types, column editable flags and additional column infos. -
Method Summary
Modifier and TypeMethodDescriptionClass<?> getColumnClass(int columnIndex) Returns the type of the data in the specified column.Returns theVectorthat contains the table's column editable flags.getColumnInfo(int column) Returns the column info for the given column index.Returns theVectorthat contains the table's column infos.Returns theVectorthat contains the table's column names.Returns theVectorthat contains the table's column types.booleanisCellEditable(int row, int column) Returnstrueif the specified column is editable.booleanisColumnEditable(int column) Returnstrueif the cells in the specified column are editable.voidsetColumnCount(int columnCount) Sets the number of columns in the model.Methods inherited from class DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAtMethods inherited from class AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Constructor Details
-
SwingTableModel
public SwingTableModel()Constructs a defaultSwingTableModelthat has zero columns and rows. -
SwingTableModel
Constructs aSwingTableModeland initializes it with the specified data and column names.See
DefaultTableModelfor details. -
SwingTableModel
public SwingTableModel(Vector<? extends Vector> data, Vector<String> columnNames, Vector<Class<?>> columnTypes, Vector<Boolean> columnEditables) Constructs aSwingTableModeland initializes it with the specified data, column names, column types and column editable flags.See
DefaultTableModelfor details. -
SwingTableModel
public SwingTableModel(Vector<? extends Vector> data, Vector<String> columnNames, Vector<Class<?>> columnTypes, Vector<Boolean> columnEditables, Vector<SwingTableColumn> columnInfos) Constructs aSwingTableModeland initializes it with the specified data, column names, column types, column editable flags and additional column infos.See
DefaultTableModelfor details.- Since:
- 3.0
-
SwingTableModel
Constructs aSwingTableModeland initializes it with the specified data and column names.See
DefaultTableModelfor details. -
SwingTableModel
Copy constructor. Copies vectors, but not the real data.
-
-
Method Details
-
getColumnNames
-
getColumnTypes
-
getColumnEditables
-
getColumnInfos
Returns theVectorthat contains the table's column infos. Each element in the vector must be aSwingTableColumn.- Since:
- 3.0
-
setColumnCount
public void setColumnCount(int columnCount) Sets the number of columns in the model.See
DefaultTableModel.setColumnCount(int)for details.- Overrides:
setColumnCountin classDefaultTableModel
-
isColumnEditable
public boolean isColumnEditable(int column) Returnstrueif the cells in the specified column are editable. -
getColumnInfo
Returns the column info for the given column index.- Since:
- 3.0
-
getColumnClass
Returns the type of the data in the specified column.See
TableModel.getColumnClass(int)for details.- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel- See Also:
-
isCellEditable
public boolean isCellEditable(int row, int column) Returnstrueif the specified column is editable.See
TableModel.isCellEditable(int, int)for details.- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classDefaultTableModel- See Also:
-