Package eu.bandm.tools.message
Class MessageStore_.TableModel
java.lang.Object
javax.swing.table.AbstractTableModel
eu.bandm.tools.message.MessageStore_.TableModel
- All Implemented Interfaces:
Serializable,TableModel
- Enclosing class:
MessageStore_<M extends Message>
Standard specialisation of
AbstractTableModel.
Usage is
frame = new javax.swing.JFrame();
frame.getContentPane().add(new javax.swing.JTable
(myMessageStore.getTableModel())
);
frame.pack();
frame.setVisibility(true);
Own specializations are inserted by ...
class myTableModel extends MessageStore.TableModel {...}
myMessageStore.setTableModel(myMessageStore.new MyTableModel()) ;
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturn the number of columns.intgetIndent(int row) Indentation level of the given table row nubmer.intReturn the total number of rows currently in the model storage.getValueAt(int row, int column) Callback defined by the Swing kernel to retrieve the data to render in the table cell.booleanisCellEditable(int row, int column) Return that no cell is editable.voidnotifyAdd(int pos) Nofication that at the given position the data has changed.voidNofication that potentially everywhere the data may have changed, because the sorting order has changed.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
-
Constructor Details
-
TableModel
public TableModel()Only constructor.
-
-
Method Details
-
getIndent
public int getIndent(int row) Indentation level of the given table row nubmer.- Parameters:
row- for which indentation is requested.- Returns:
- the indentation level of the given table row nubmer, or constant zero when no indentation is maintained.
-
notifyAdd
public void notifyAdd(int pos) Nofication that at the given position the data has changed. Triggers graphic repainting.- Parameters:
pos- where an message has been added or inserted.
-
notifySortingChanged
public void notifySortingChanged()Nofication that potentially everywhere the data may have changed, because the sorting order has changed. Triggers graphic repainting. -
getRowCount
public int getRowCount()Return the total number of rows currently in the model storage. Callback needed by the Swing kernel.- Returns:
- the row count in the model storage.
-
getColumnCount
public int getColumnCount()Return the number of columns. Callback needed by the Swing kernel.- Returns:
- the number of columns, fixed to 2 (location and text).
-
isCellEditable
public boolean isCellEditable(int row, int column) Return that no cell is editable.- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel- Parameters:
row- the row number which is inquired.column- the column number which is inquired.- Returns:
- false for every cell.
-
getValueAt
Callback defined by the Swing kernel to retrieve the data to render in the table cell. Here the message in the row will be returned for all columns; the renderer of a particular column must extract its info.- Parameters:
row- the row number which is inquired.column- the column number which is inquired.- Returns:
- the message stored in the given row.
-