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
-
Method Summary
Modifier and TypeMethodDescriptionint
Deliver the number of columns.int
getIndent
(int row) Indentation level of the given table row nubmer.int
Deliver 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.boolean
isCellEditable
(int row, int column) Return that no cell is editable.void
notifyAdd
(int pos) Nofication that at the given position the data has changed.void
Nofication that potentially everywhere the data may have 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()
-
-
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.
-
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. Triggers graphic repainting. -
getRowCount
public int getRowCount()Deliver 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()Deliver 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:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in 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.
-