Package org.apache.log4j.lf5.viewer
Class FilteredLogTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.apache.log4j.lf5.viewer.FilteredLogTableModel
-
- All Implemented Interfaces:
Serializable,TableModel
public class FilteredLogTableModel extends AbstractTableModel
A TableModel for LogRecords which includes filtering support.- Author:
- Richard Wan, Brent Sprecher
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List_allRecordsprotected String[]_colNamesprotected LogRecordFilter_filterprotected List_filteredRecordsprotected int_maxNumberOfLogRecords-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description FilteredLogTableModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddLogRecord(LogRecord record)voidclear()Clears all records from the LogTableModelprotected ListcreateFilteredRecordsList()voidfastRefresh()protected ObjectgetColumn(int col, LogRecord lr)intgetColumnCount()StringgetColumnName(int i)protected LogRecordgetFilteredRecord(int row)protected ListgetFilteredRecords()LogRecordFiltergetLogRecordFilter()intgetRowCount()intgetTotalRowCount()ObjectgetValueAt(int row, int col)protected booleanneedsTrimming()voidrefresh()Forces the LogTableModel to requery its filters to determine which records to display.voidsetLogRecordFilter(LogRecordFilter filter)voidsetMaxNumberOfLogRecords(int maxNumRecords)protected voidtrimOldestRecords()protected voidtrimRecords()-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
Field Detail
-
_filter
protected LogRecordFilter _filter
-
_allRecords
protected List _allRecords
-
_filteredRecords
protected List _filteredRecords
-
_maxNumberOfLogRecords
protected int _maxNumberOfLogRecords
-
_colNames
protected String[] _colNames
-
-
Method Detail
-
setLogRecordFilter
public void setLogRecordFilter(LogRecordFilter filter)
-
getLogRecordFilter
public LogRecordFilter getLogRecordFilter()
-
getColumnName
public String getColumnName(int i)
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
getColumnCount
public int getColumnCount()
-
getRowCount
public int getRowCount()
-
getTotalRowCount
public int getTotalRowCount()
-
getValueAt
public Object getValueAt(int row, int col)
-
setMaxNumberOfLogRecords
public void setMaxNumberOfLogRecords(int maxNumRecords)
-
addLogRecord
public boolean addLogRecord(LogRecord record)
-
refresh
public void refresh()
Forces the LogTableModel to requery its filters to determine which records to display.
-
fastRefresh
public void fastRefresh()
-
clear
public void clear()
Clears all records from the LogTableModel
-
getFilteredRecords
protected List getFilteredRecords()
-
createFilteredRecordsList
protected List createFilteredRecordsList()
-
getFilteredRecord
protected LogRecord getFilteredRecord(int row)
-
trimRecords
protected void trimRecords()
-
needsTrimming
protected boolean needsTrimming()
-
trimOldestRecords
protected void trimOldestRecords()
-
-