public class RecordSelectTableModel extends MustTableModel
Constructor and Description |
---|
RecordSelectTableModel(java.lang.String[] columnNames) |
Modifier and Type | Method and Description |
---|---|
void |
addIndexedRow(java.lang.Object[] visualItems,
Identifier identifier)
Adds a row with an identifier.
|
void |
addIndexedRowInFirstLine(java.lang.Object[] visualItems,
Identifier identifier,
int maxRows)
Inserts a new row the model.
|
Identifier |
getIdentifier(int row)
Return the identifier of the row as specified.
|
javax.swing.table.TableRowSorter<javax.swing.table.TableModel> |
getRowSorter()
Returns the used TableRowSorter.
|
java.lang.Object |
getValueAsShownAt(int row,
int col)
Returns the value for the cell at
columnIndex and
rowIndex as shown, e.g. after using rowsort functionality. |
boolean |
isCellEditable(int row,
int column) |
void |
removeAll()
Clears the table including the associated identifiers.
|
void |
removeRow(int rowIndex) |
void |
resetSort() |
void |
setCellEditable(int row,
int column,
boolean editable)
Sets the flag if the cell is editable.
|
void |
setColumnEditable(int column,
boolean editable)
Sets the flag if the column is editable in general for all rows.
|
void |
setRowSorter(javax.swing.JTable table)
Activates standard row sorting.
|
void |
setRowSorter(javax.swing.JTable table,
javax.swing.table.TableRowSorter<javax.swing.table.TableModel> tableRowSorter)
Activates row sorting with the TableRowSorter as specified.
|
void |
updateRow(java.lang.Object[] visualItems,
int rowIndex)
Updates the values of one row.
|
getColumnClass, setColumnClasses
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
public RecordSelectTableModel(java.lang.String[] columnNames)
public void setColumnEditable(int column, boolean editable)
column
- the index of the column to seteditable
- whether or not the column is editable in generalpublic void setCellEditable(int row, int column, boolean editable)
removeRow(int)
row
- the index of the row to setcolumn
- the index of the column to seteditable
- whether or not the column is editable in generalpublic void setRowSorter(javax.swing.JTable table)
table
- the table to be sorting-enabledpublic void setRowSorter(javax.swing.JTable table, javax.swing.table.TableRowSorter<javax.swing.table.TableModel> tableRowSorter)
table
- the table to be sorting-enabledtableRowSorter
- the TableRowSorter to usepublic javax.swing.table.TableRowSorter<javax.swing.table.TableModel> getRowSorter()
public void resetSort()
public void removeAll()
public void removeRow(int rowIndex)
removeRow
in class javax.swing.table.DefaultTableModel
public Identifier getIdentifier(int row)
row
- the row's indexpublic boolean isCellEditable(int row, int column)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.DefaultTableModel
public java.lang.Object getValueAsShownAt(int row, int col)
columnIndex
and
rowIndex
as shown, e.g. after using rowsort functionality.rowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queriedpublic void addIndexedRow(java.lang.Object[] visualItems, Identifier identifier)
visualItems
- the cell values if the rowidentifier
- the identifier of the database table rowpublic void addIndexedRowInFirstLine(java.lang.Object[] visualItems, Identifier identifier, int maxRows)
visualItems
- the cell values if the rowidentifier
- the identifier to insertitemIndex
- index (position of the identifier to insert)maxRows
- the maximum of rows to be hold in the array - last item will vanish if size > maxRowspublic void updateRow(java.lang.Object[] visualItems, int rowIndex)
visualItems
- the cell values to be updatedrowIndex
- the row's indexCopyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de