public class ObjectTableModel
extends javax.swing.table.AbstractTableModel
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap |
columnclasses
The classes of the columns.
|
protected java.util.Vector |
columns
The data.
|
protected java.util.HashSet |
columseditable
The editable colums.
|
protected java.util.Vector |
data
The data.
|
Constructor and Description |
---|
ObjectTableModel()
Create a new object table model.
|
ObjectTableModel(java.lang.String[] colnames)
Create a new object table model.
|
Modifier and Type | Method and Description |
---|---|
void |
addRow(java.util.ArrayList row,
java.lang.Object object)
Add a row to the model.
|
void |
addRow(java.lang.Object[] row,
java.lang.Object object)
Add a row to the model.
|
void |
addRow(java.lang.Object row,
java.lang.Object object)
Add a row to the model.
|
java.lang.Class |
getColumnClass(int idx)
Get the class of the column.
|
int |
getColumnCount() |
java.lang.String |
getColumnName(int column)
Get a column name
|
java.lang.Object |
getObjectForRow(int rowcnt)
Get the associated object for a row.
|
int |
getRowCount() |
java.lang.Object |
getValueAt(int row,
int column)
Get the value from a field.
|
void |
insertRow(int rowcnt,
java.util.List row,
java.lang.Object object)
Insert a row at a position.
|
void |
insertRow(int rowcnt,
java.lang.Object[] row,
java.lang.Object object)
Insert a row at a position.
|
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Returns false.
|
void |
modifyData(java.lang.Object val,
int rowcnt,
int columncnt)
Modify a row at a position.
|
void |
removeAllRows()
Remove all rows from the model.
|
void |
removeRow(int cnt)
Remove a row from the model.
|
void |
removeRow(java.lang.Object object)
Remove a row from the model.
|
void |
setColumnClass(java.lang.Class clazz,
int idx)
Set the class of the column.
|
void |
setColumnEditable(boolean editable,
int col)
Set if a column is editable.
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
protected java.util.Vector columns
protected java.util.Vector data
protected java.util.HashMap columnclasses
protected java.util.HashSet columseditable
public ObjectTableModel()
public ObjectTableModel(java.lang.String[] colnames)
public void addRow(java.lang.Object row, java.lang.Object object)
row
- The row data.object
- The associated object.public void addRow(java.util.ArrayList row, java.lang.Object object)
row
- The row data.object
- The associated object.public void addRow(java.lang.Object[] row, java.lang.Object object)
row
- The row data.object
- The associated object.public void insertRow(int rowcnt, java.lang.Object[] row, java.lang.Object object)
rowcnt
- The row cnt.row
- The row data.object
- The object.public void insertRow(int rowcnt, java.util.List row, java.lang.Object object)
rowcnt
- The row cnt.row
- The row data.object
- The object.public void removeRow(java.lang.Object object)
object
- The associated object.public void removeRow(int cnt)
cnt
- The row number.public void removeAllRows()
public void modifyData(java.lang.Object val, int rowcnt, int columncnt)
val
- The value.rowcnt
- The row.columncnt
- The column.public java.lang.Object getObjectForRow(int rowcnt)
rowcnt
- The row ccount.public java.lang.String getColumnName(int column)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
column
- The number of the column.public java.lang.Class getColumnClass(int idx)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
idx
- the column being queriedpublic void setColumnClass(java.lang.Class clazz, int idx)
clazz
- The class.idx
- the column being queriedpublic void setColumnEditable(boolean editable, int col)
editable
- True, for editable.col
- The column.public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
rowIndex
- the row being queriedcolumnIndex
- the column being queriedpublic int getRowCount()
public int getColumnCount()
public java.lang.Object getValueAt(int row, int column)
row
- The row index.column
- The column index.