Package org.apache.log4j.lf5.viewer
Class FilteredLogTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.apache.log4j.lf5.viewer.FilteredLogTableModel
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.table.TableModel
public class FilteredLogTableModel extends javax.swing.table.AbstractTableModel
A TableModel for LogRecords which includes filtering support.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List
_allRecords
protected java.lang.String[]
_colNames
protected LogRecordFilter
_filter
protected java.util.List
_filteredRecords
protected int
_maxNumberOfLogRecords
-
Constructor Summary
Constructors Constructor Description FilteredLogTableModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addLogRecord(LogRecord record)
void
clear()
Clears all records from the LogTableModelprotected java.util.List
createFilteredRecordsList()
void
fastRefresh()
protected java.lang.Object
getColumn(int col, LogRecord lr)
int
getColumnCount()
java.lang.String
getColumnName(int i)
protected LogRecord
getFilteredRecord(int row)
protected java.util.List
getFilteredRecords()
LogRecordFilter
getLogRecordFilter()
int
getRowCount()
int
getTotalRowCount()
java.lang.Object
getValueAt(int row, int col)
protected boolean
needsTrimming()
private int
numberOfRecordsToTrim()
void
refresh()
Forces the LogTableModel to requery its filters to determine which records to display.void
setLogRecordFilter(LogRecordFilter filter)
void
setMaxNumberOfLogRecords(int maxNumRecords)
protected void
trimOldestRecords()
protected void
trimRecords()
-
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 java.util.List _allRecords
-
_filteredRecords
protected java.util.List _filteredRecords
-
_maxNumberOfLogRecords
protected int _maxNumberOfLogRecords
-
_colNames
protected java.lang.String[] _colNames
-
-
Method Detail
-
setLogRecordFilter
public void setLogRecordFilter(LogRecordFilter filter)
-
getLogRecordFilter
public LogRecordFilter getLogRecordFilter()
-
getColumnName
public java.lang.String getColumnName(int i)
- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classjavax.swing.table.AbstractTableModel
-
getColumnCount
public int getColumnCount()
-
getRowCount
public int getRowCount()
-
getTotalRowCount
public int getTotalRowCount()
-
getValueAt
public java.lang.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 java.util.List getFilteredRecords()
-
createFilteredRecordsList
protected java.util.List createFilteredRecordsList()
-
getFilteredRecord
protected LogRecord getFilteredRecord(int row)
-
getColumn
protected java.lang.Object getColumn(int col, LogRecord lr)
-
trimRecords
protected void trimRecords()
-
needsTrimming
protected boolean needsTrimming()
-
trimOldestRecords
protected void trimOldestRecords()
-
numberOfRecordsToTrim
private int numberOfRecordsToTrim()
-
-