SalesPoint Framework v3.1

log.swing
Class LogTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byutil.swing.AbstractTableModel
          extended bylog.swing.LogTableModel
All Implemented Interfaces:
Serializable, TableModel

public class LogTableModel
extends AbstractTableModel

Swing model for tables that can display log file contents. This model is static and cannot be changed.

Since:
v2.0
Author:
Steffen Zschaler
See Also:
LogInputStream, JLogTable, DefaultLogEntryTED, Serialized Form

Field Summary
protected  List m_lEntries
          The LogEntries in the same order in which they appear in the table.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
LogTableModel(LogFileContent lfc, Comparator cmp, TableEntryDescriptor ted)
          Create a new LogTableModel.
 
Method Summary
 Object getRecord(int nRow)
          Return the LogEntry at row nRow.
 int getRowCount()
          Return the total amount of LogEntries in the model.
 void setData(Object n_lModel)
          Set the table's data.
 
Methods inherited from class util.swing.AbstractTableModel
getColumnClass, getColumnCount, getColumnName, getEntryDescriptor, getValueAt, isCellEditable, orderByColumn, reOrderBy, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_lEntries

protected List m_lEntries
The LogEntries in the same order in which they appear in the table.

Constructor Detail

LogTableModel

public LogTableModel(LogFileContent lfc,
                     Comparator cmp,
                     TableEntryDescriptor ted)
Create a new LogTableModel. Usually you do not create a new model directly, but rather instantiate a new JLogTable.

Parameters:
lfc - the LogFileContent that contains the LogEntries to be displayed.
cmp - a Comparator that defines the order the LogEntries appear in. May be null in which case LogEntries will be sorted by the log date.
ted - a TableEntryDescriptor defining how LogEntries are to be displayed with respect to rows and columns in a table.
See Also:
DefaultLogEntryTED
Method Detail

setData

public void setData(Object n_lModel)
Set the table's data. This actually has no effect here.

Specified by:
setData in class AbstractTableModel
Parameters:
n_lModel - the new data

getRecord

public Object getRecord(int nRow)
Return the LogEntry at row nRow.

Specified by:
getRecord in class AbstractTableModel
Parameters:
nRow - the row index for which to return the record. Row indices run from 0 to getRowCount() - 1.
Returns:
the record associated to the given row. May return null, instead of throwing an exception, if the given index is without its bounds.

getRowCount

public int getRowCount()
Return the total amount of LogEntries in the model.


SalesPoint Framework v3.1