com.mindtree.techworks.insight.model
Class LogEventTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.mindtree.techworks.insight.model.LogEventTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class LogEventTableModel
extends javax.swing.table.AbstractTableModel

The LogEventTableModel class is a derivative of the Swing AbstractTableModel. It defines the table model used by the log viewer to display LoggingEvent summary information.

Version:
1.0, 04/10/25
Author:
Regunath B
See Also:
javax.swing.AbstractTableModel, LoggingEvent, Serialized Form

Field Summary
static int CATEGORY_INDEX
           
static int CLASS_INDEX
           
static java.util.HashMap COL_NAMES
           
static int EXCEPTION_NAME_INDEX
           
static int FILE_INDEX
           
static int FIRST_INDEX
           
static int LAST_INDEX
           
static int LINE_INDEX
           
static int MESSAGE_INDEX
           
static int METHOD_INDEX
           
static int PRIORITY_INDEX
           
static int RELATIVETIME_INDEX
           
static int THREAD_INDEX
           
static int TIME_INDEX
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
LogEventTableModel(int[] columnList)
          Constructor for this class
 
Method Summary
 void addLogEvent(LogEvent event)
          Adds the specified LoggingEvent to the list of events rendered by the JTable backed by this AbstractTableModel
 void changeDisplayColumns(int[] columnList)
          Dynamically changes the columns displayed by this model to the ones specified
 void clearModel()
          Clears the data contained by this TableModel.
 int getColumnCount()
          Superclass method implementation
 int[] getColumnList()
           
 java.lang.String getColumnName(int col)
          Superclass method implementation
 LogEvent getLoggingEvent(int index)
          Gets the LogEvent from the model, identifed by the specified index
 int getRowCount()
          Superclass method implementation
 int getSortOrder(int columnIndex)
          Returns the sort order for the column specified by the columnIndex
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          Superclass method implementation
 void setColumnList(int[] columnList)
           
 void sortColumn(int columnIndex)
          Sorts the data held by this TableModel.
 void updateDataModel(java.util.List logEventList)
          Updates this TableModel with the data specified.
 void updateDataModelAndDisplay(java.util.List logEventList)
          Updates this TableModel and the display with the data specified.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COL_NAMES

public static final java.util.HashMap COL_NAMES

FIRST_INDEX

public static final int FIRST_INDEX
See Also:
Constant Field Values

TIME_INDEX

public static final int TIME_INDEX
See Also:
Constant Field Values

THREAD_INDEX

public static final int THREAD_INDEX
See Also:
Constant Field Values

PRIORITY_INDEX

public static final int PRIORITY_INDEX
See Also:
Constant Field Values

CATEGORY_INDEX

public static final int CATEGORY_INDEX
See Also:
Constant Field Values

MESSAGE_INDEX

public static final int MESSAGE_INDEX
See Also:
Constant Field Values

EXCEPTION_NAME_INDEX

public static final int EXCEPTION_NAME_INDEX
See Also:
Constant Field Values

METHOD_INDEX

public static final int METHOD_INDEX
See Also:
Constant Field Values

LINE_INDEX

public static final int LINE_INDEX
See Also:
Constant Field Values

FILE_INDEX

public static final int FILE_INDEX
See Also:
Constant Field Values

CLASS_INDEX

public static final int CLASS_INDEX
See Also:
Constant Field Values

RELATIVETIME_INDEX

public static final int RELATIVETIME_INDEX
See Also:
Constant Field Values

LAST_INDEX

public static final int LAST_INDEX
See Also:
Constant Field Values
Constructor Detail

LogEventTableModel

public LogEventTableModel(int[] columnList)
Constructor for this class

Parameters:
int - array containing valid column identifiers defined in this class
Method Detail

changeDisplayColumns

public void changeDisplayColumns(int[] columnList)
Dynamically changes the columns displayed by this model to the ones specified

Parameters:
columnList - int array containing valid column identifiers defined in this class

getRowCount

public int getRowCount()
Superclass method implementation

See Also:
TableModel.getRowCount()

getColumnCount

public int getColumnCount()
Superclass method implementation

See Also:
TableModel.getColumnCount()

getColumnName

public java.lang.String getColumnName(int col)
Superclass method implementation

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
See Also:
TableModel.getColumnName(int)

addLogEvent

public void addLogEvent(LogEvent event)
Adds the specified LoggingEvent to the list of events rendered by the JTable backed by this AbstractTableModel

Parameters:
event - the LogEvent to be added to the model

getLoggingEvent

public LogEvent getLoggingEvent(int index)
Gets the LogEvent from the model, identifed by the specified index

Parameters:
index - index of the LogEvent in the internal List
Returns:
LogEvent available at the specified index

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Superclass method implementation

See Also:
TableModel.getValueAt(int, int)

sortColumn

public void sortColumn(int columnIndex)
Sorts the data held by this TableModel.

Parameters:
columnIndex - the index of column data that needs to be sorted

getSortOrder

public int getSortOrder(int columnIndex)
Returns the sort order for the column specified by the columnIndex

Parameters:
columnIndex - the index of the column whose sort order is needed
Returns:
the valid sort order as defined by the ModelDataSorter class

clearModel

public void clearModel()
Clears the data contained by this TableModel. Updates the JTable backed by this TableModel.


updateDataModel

public void updateDataModel(java.util.List logEventList)
Updates this TableModel with the data specified. The data maintained by this model is cleared and the ones in the specified List added.

Parameters:
logEventList - the List of LogEvent instances to update this model with

updateDataModelAndDisplay

public void updateDataModelAndDisplay(java.util.List logEventList)
Updates this TableModel and the display with the data specified. The data maintained by this model is cleared and the ones in the specified List added.

Parameters:
logEventList - the List of LogEvent instances to display

getColumnList

public int[] getColumnList()
Returns:
Returns the columnList.

setColumnList

public void setColumnList(int[] columnList)
Parameters:
columnList - The columnList to set.


Copyright © 2003-2008 MindTree Consulting Ltd.. All Rights Reserved.