logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r1022406 [1/3] - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/ java/org/apache/log4j/chainsaw/messages/ java/org/apache/log4j/chainsaw/vfs/ resources/org/apache/log4j/chainsaw/help/ resources/org/apache/log4j/chainsaw...
Date Thu, 14 Oct 2010 08:01:37 GMT
Author: sdeboy
Date: Thu Oct 14 08:01:36 2010
New Revision: 1022406

URL: http://svn.apache.org/viewvc?rev=1022406&view=rev
Log:
Added log panel preference to display search results in the detail panel.  When the preference
is enabled and a search is performed, the matching rows are displayed in a table in the details
panel.  Clicking on a row in that table selects the row in the main event table.

Search table automatically hides when search field is cleared (and event details are displayed
if the 'show details' preference is enabled)

Added:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggingEventWrapper.java
      - copied, changed from r1021624, logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ExtendedLoggingEvent.java
Removed:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ExtendedLoggingEvent.java
Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawConstants.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ColumnComparator.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/CopyEventsToClipboardAction.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/EventContainer.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileSaveAction.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/JSortTable.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferenceModel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/RuleMediator.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/messages/MessageCenter.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/vfs/VFSLogFilePatternReceiver.java
    logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html
    logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawConstants.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawConstants.java?rev=1022406&r1=1022405&r2=1022406&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawConstants.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawConstants.java
Thu Oct 14 08:01:36 2010
@@ -38,7 +38,10 @@ public class ChainsawConstants {
   public static final Color COLOR_DEFAULT_BACKGROUND = new Color(255,255,255);
   public static final Color COLOR_DEFAULT_FOREGROUND = Color.BLACK;
 
-  public static final int DEFAULT_ROW_HEIGHT = 20;
+  //top, bottom left and right border are all 2
+  public static final int TABLE_BORDER_WIDTH = 2;
+  //JTable defines its default height as 16, plus top & bottom borders
+  public static final int DEFAULT_ROW_HEIGHT = 16 + (TABLE_BORDER_WIDTH * 2);
   public static final Color FIND_LOGGER_BACKGROUND = new Color(213, 226, 235);
   public static final Color FIND_LOGGER_FOREGROUND = Color.BLACK;
 

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java?rev=1022406&r1=1022405&r2=1022406&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java
Thu Oct 14 08:01:36 2010
@@ -66,7 +66,9 @@ class ChainsawCyclicBufferTableModel ext
   //cyclic field used internally in this class, but not exposed via the eventcontainer
   private boolean cyclic = true;
   private int cyclicBufferSize = DEFAULT_CAPACITY;
+  //original list of LoggingEventWrapper instances
   List unfilteredList;
+  //filtered list of LoggingEventWrapper instances
   List filteredList;
   private boolean currentSortAscending;
   private int currentSortColumn;
@@ -80,18 +82,20 @@ class ChainsawCyclicBufferTableModel ext
   private final LoggerNameModel loggerNameModelDelegate = new LoggerNameModelSupport();
   private final Object mutex = new Object();
 
-  //because we may be using a cyclic buffer, if an ID is not provided in the property, 
+  //because we may be using a cyclic buffer, if an ID is not provided in the property,
   //use and increment this row counter as the ID for each received row
   int uniqueRow;
   private final Set uniquePropertyKeys = new HashSet();
   private Rule displayRule;
   private final PropertyChangeSupport propertySupport = new PropertyChangeSupport(this);
   private RuleColorizer colorizer;
+  private final String tableModelName;
 
-    public ChainsawCyclicBufferTableModel(int cyclicBufferSize, RuleColorizer colorizer)
{
+    public ChainsawCyclicBufferTableModel(int cyclicBufferSize, RuleColorizer colorizer,
String tableModelName) {
     propertySupport.addPropertyChangeListener("cyclic", new ModelChanger());
     this.cyclicBufferSize = cyclicBufferSize;
     this.colorizer = colorizer;
+    this.tableModelName = tableModelName;
 
     unfilteredList = new CyclicBufferList(cyclicBufferSize);
     filteredList = new CyclicBufferList(cyclicBufferSize);
@@ -116,10 +120,10 @@ class ChainsawCyclicBufferTableModel ext
     Iterator iter = unfilteredCopy.iterator();
 
     while (iter.hasNext()) {
-      LoggingEvent event = (LoggingEvent) iter.next();
+      LoggingEventWrapper loggingEventWrapper = (LoggingEventWrapper) iter.next();
 
-      if (rule.evaluate(event, null)) {
-        list.add(event);
+      if (rule.evaluate(loggingEventWrapper.getLoggingEvent(), null)) {
+        list.add(loggingEventWrapper);
       }
     }
 
@@ -135,27 +139,27 @@ class ChainsawCyclicBufferTableModel ext
             previousSize = filteredList.size();
             filteredList.clear();
             if (displayRule == null) {
-                LoggingEvent lastEvent = null;
+                LoggingEventWrapper lastEvent = null;
                 for (Iterator iter = unfilteredList.iterator();iter.hasNext();) {
-                    ExtendedLoggingEvent e = (ExtendedLoggingEvent)iter.next();
-                    e.setDisplayed(true);
-                    updateEventMillisDelta(e, lastEvent);
-                    filteredList.add(e);
-                    lastEvent = e;
+                    LoggingEventWrapper loggingEventWrapper = (LoggingEventWrapper)iter.next();
+                    loggingEventWrapper.setDisplayed(true);
+                    updateEventMillisDelta(loggingEventWrapper, lastEvent);
+                    filteredList.add(loggingEventWrapper);
+                    lastEvent = loggingEventWrapper;
                 }
             } else {
                 Iterator iter = unfilteredList.iterator();
-                LoggingEvent lastEvent = null;
+                LoggingEventWrapper lastEvent = null;
                 while (iter.hasNext()) {
-                  ExtendedLoggingEvent e = (ExtendedLoggingEvent) iter.next();
+                  LoggingEventWrapper loggingEventWrapper = (LoggingEventWrapper) iter.next();
 
-                  if (displayRule.evaluate(e, null)) {
-                    e.setDisplayed(true);
-                    filteredList.add(e);
-                    updateEventMillisDelta(e, lastEvent);
-                    lastEvent = e;
+                  if (displayRule.evaluate(loggingEventWrapper.getLoggingEvent(), null))
{
+                    loggingEventWrapper.setDisplayed(true);
+                    filteredList.add(loggingEventWrapper);
+                    updateEventMillisDelta(loggingEventWrapper, lastEvent);
+                    lastEvent = loggingEventWrapper;
                   } else {
-                    e.setDisplayed(false);
+                    loggingEventWrapper.setDisplayed(false);
                   }
                 }
             }
@@ -200,25 +204,25 @@ class ChainsawCyclicBufferTableModel ext
     }
       if (searchForward) {
         for (int i = startLocation; i < filteredListCopy.size(); i++) {
-          if (rule.evaluate((LoggingEvent) filteredListCopy.get(i), null)) {
+          if (rule.evaluate(((LoggingEventWrapper) filteredListCopy.get(i)).getLoggingEvent(),
null)) {
             return i;
           }
         }
         //if there was no match, start at row zero and go to startLocation
         for (int i = 0; i < startLocation; i++) {
-          if (rule.evaluate((LoggingEvent) filteredListCopy.get(i), null)) {
+          if (rule.evaluate(((LoggingEventWrapper) filteredListCopy.get(i)).getLoggingEvent(),
null)) {
             return i;
           }
         }
       } else {
         for (int i = startLocation; i > -1; i--) {
-          if (rule.evaluate((LoggingEvent) filteredListCopy.get(i), null)) {
+          if (rule.evaluate(((LoggingEventWrapper) filteredListCopy.get(i)).getLoggingEvent(),
null)) {
             return i;
           }
         }
         //if there was no match, start at row list.size() - 1 and go to startLocation
         for (int i = filteredListCopy.size() - 1; i > startLocation; i--) {
-          if (rule.evaluate((LoggingEvent) filteredListCopy.get(i), null)) {
+          if (rule.evaluate(((LoggingEventWrapper) filteredListCopy.get(i)).getLoggingEvent(),
null)) {
             return i;
           }
         }
@@ -242,6 +246,12 @@ class ChainsawCyclicBufferTableModel ext
     return loggerNameModelDelegate.addLoggerName(loggerName);
   }
 
+  public String toString() {
+    return "ChainsawCyclicBufferTableModel{" +
+        "name='" + tableModelName + '\'' +
+        '}';
+  }
+
   public void reset() {
       loggerNameModelDelegate.reset();
   }
@@ -317,9 +327,9 @@ class ChainsawCyclicBufferTableModel ext
           sort = (sortEnabled && filteredListSize > 0);
         if (sort) {
             //reset display (used to ensure row height is updated)
-            LoggingEvent lastEvent = null;
+            LoggingEventWrapper lastEvent = null;
             for (Iterator iter = filteredList.iterator();iter.hasNext();) {
-                ExtendedLoggingEvent e = (ExtendedLoggingEvent)iter.next();
+                LoggingEventWrapper e = (LoggingEventWrapper)iter.next();
                 e.setDisplayed(true);
                 updateEventMillisDelta(e, lastEvent);
                 lastEvent = e;
@@ -388,9 +398,9 @@ class ChainsawCyclicBufferTableModel ext
   	}
   }
   
-  public int getRowIndex(LoggingEvent e) {
+  public int getRowIndex(LoggingEventWrapper loggingEventWrapper) {
     synchronized (mutex) {
-      return filteredList.indexOf(e);
+      return filteredList.indexOf(loggingEventWrapper);
     }
   }
 
@@ -403,16 +413,16 @@ class ChainsawCyclicBufferTableModel ext
             unfilteredListCopy = new ArrayList(unfilteredList);
         }
         for (int i=0;i<filteredListCopy.size();i++) {
-            LoggingEvent event = (LoggingEvent)filteredListCopy.get(i);
-            Object result = event.removeProperty(propName);
+            LoggingEventWrapper loggingEventWrapper = (LoggingEventWrapper)filteredListCopy.get(i);
+            Object result = loggingEventWrapper.removeProperty(propName);
             if (result != null) {
                 fireRowUpdated(i, false);
             }
         }
         //now remove the event from all events
         for (Iterator iter = unfilteredListCopy.iterator();iter.hasNext();) {
-            LoggingEvent event = (LoggingEvent)iter.next();
-            event.removeProperty(propName);
+            LoggingEventWrapper loggingEventWrapper = (LoggingEventWrapper)iter.next();
+            loggingEventWrapper.removeProperty(propName);
         }
     }
 
@@ -423,9 +433,9 @@ class ChainsawCyclicBufferTableModel ext
             unfilteredListCopy = new ArrayList(unfilteredList);
         }
         for (Iterator iter = unfilteredListCopy.iterator();iter.hasNext();) {
-            ExtendedLoggingEvent extendedLoggingEvent = (ExtendedLoggingEvent) iter.next();
-            extendedLoggingEvent.evaluateSearchRule(findRule);
-            if (extendedLoggingEvent.isSearchMatch()) {
+            LoggingEventWrapper loggingEventWrapper = (LoggingEventWrapper) iter.next();
+            loggingEventWrapper.evaluateSearchRule(findRule);
+            if (loggingEventWrapper.isSearchMatch()) {
                 count++;
             }
         }
@@ -439,7 +449,7 @@ class ChainsawCyclicBufferTableModel ext
         }
         if (searchForward) {
           for (int i = startLocation; i < filteredListCopy.size(); i++) {
-            ExtendedLoggingEvent event = (ExtendedLoggingEvent)filteredListCopy.get(i);
+            LoggingEventWrapper event = (LoggingEventWrapper)filteredListCopy.get(i);
             if (!event.getColorRuleBackground().equals(ChainsawConstants.COLOR_DEFAULT_BACKGROUND)
||
                     !event.getColorRuleForeground().equals(ChainsawConstants.COLOR_DEFAULT_FOREGROUND))
{
                 return i;
@@ -447,7 +457,7 @@ class ChainsawCyclicBufferTableModel ext
           }
           //searching forward, no colorized event was found - now start at row zero and go
to startLocation
           for (int i = 0; i < startLocation; i++) {
-            ExtendedLoggingEvent event = (ExtendedLoggingEvent)filteredListCopy.get(i);
+            LoggingEventWrapper event = (LoggingEventWrapper)filteredListCopy.get(i);
             if (!event.getColorRuleBackground().equals(ChainsawConstants.COLOR_DEFAULT_BACKGROUND)
||
                     !event.getColorRuleForeground().equals(ChainsawConstants.COLOR_DEFAULT_FOREGROUND))
{
                 return i;
@@ -455,7 +465,7 @@ class ChainsawCyclicBufferTableModel ext
           }
         } else {
           for (int i = startLocation; i > -1; i--) {
-              ExtendedLoggingEvent event = (ExtendedLoggingEvent)filteredListCopy.get(i);
+              LoggingEventWrapper event = (LoggingEventWrapper)filteredListCopy.get(i);
               if (!event.getColorRuleBackground().equals(ChainsawConstants.COLOR_DEFAULT_BACKGROUND)
||
                       !event.getColorRuleForeground().equals(ChainsawConstants.COLOR_DEFAULT_FOREGROUND))
{
                   return i;
@@ -463,7 +473,7 @@ class ChainsawCyclicBufferTableModel ext
           }
           //searching backward, no colorized event was found - now start at list.size() -
1 and go to startLocation
           for (int i = filteredListCopy.size() - 1; i > startLocation; i--) {
-              ExtendedLoggingEvent event = (ExtendedLoggingEvent)filteredListCopy.get(i);
+              LoggingEventWrapper event = (LoggingEventWrapper)filteredListCopy.get(i);
               if (!event.getColorRuleBackground().equals(ChainsawConstants.COLOR_DEFAULT_BACKGROUND)
||
                       !event.getColorRuleForeground().equals(ChainsawConstants.COLOR_DEFAULT_FOREGROUND))
{
                   return i;
@@ -482,10 +492,10 @@ class ChainsawCyclicBufferTableModel ext
       return (String) columnNames.get(column);
   }
 
-  public ExtendedLoggingEvent getRow(int row) {
+  public LoggingEventWrapper getRow(int row) {
     synchronized (mutex) {
       if (row < filteredList.size() && row > -1) {
-        return (ExtendedLoggingEvent) filteredList.get(row);
+        return (LoggingEventWrapper) filteredList.get(row);
       }
     }
 
@@ -503,7 +513,7 @@ class ChainsawCyclicBufferTableModel ext
 
     synchronized (mutex) {
       if (rowIndex < filteredList.size() && rowIndex > -1) {
-        event = (LoggingEvent) filteredList.get(rowIndex);
+        event = ((LoggingEventWrapper) filteredList.get(rowIndex)).getLoggingEvent();
       }
     }
 
@@ -590,20 +600,21 @@ class ChainsawCyclicBufferTableModel ext
     return "";
   }
 
-  public boolean isAddRow(ExtendedLoggingEvent e) {
-    e.updateColorRuleColors(colorizer.getBackgroundColor(e), colorizer.getForegroundColor(e));
+  public boolean isAddRow(LoggingEventWrapper loggingEventWrapper) {
+    loggingEventWrapper.updateColorRuleColors(colorizer.getBackgroundColor(loggingEventWrapper.getLoggingEvent()),
colorizer.getForegroundColor(loggingEventWrapper.getLoggingEvent()));
     Rule findRule = colorizer.getFindRule();
     if (findRule != null) {
-      e.evaluateSearchRule(colorizer.getFindRule());
+      loggingEventWrapper.evaluateSearchRule(colorizer.getFindRule());
     }
 
     boolean rowAdded = false;
 
-    Object id = e.getProperty(Constants.LOG4J_ID_KEY);
+    Object id = loggingEventWrapper.getLoggingEvent().getProperty(Constants.LOG4J_ID_KEY);
 
+    //only set the property if it doesn't already exist
     if (id == null) {
       id = new Integer(++uniqueRow);
-      e.setProperty(Constants.LOG4J_ID_KEY, id.toString());
+      loggingEventWrapper.setProperty(Constants.LOG4J_ID_KEY, id.toString());
     }
 
     /**
@@ -620,48 +631,48 @@ class ChainsawCyclicBufferTableModel ext
             }
         }
         int unfilteredSize = unfilteredList.size();
-        LoggingEvent lastEvent = null;
+        LoggingEventWrapper lastLoggingEventWrapper = null;
         if (unfilteredSize > 0) {
-            lastEvent = (LoggingEvent) unfilteredList.get(unfilteredSize - 1);
+            lastLoggingEventWrapper = (LoggingEventWrapper) unfilteredList.get(unfilteredSize
- 1);
         }
-        unfilteredList.add(e);
-        if ((displayRule == null) || (displayRule.evaluate(e, null))) {
-            e.setDisplayed(true);
-            updateEventMillisDelta(e, lastEvent);
-            filteredList.add(e);
+        unfilteredList.add(loggingEventWrapper);
+        if ((displayRule == null) || (displayRule.evaluate(loggingEventWrapper.getLoggingEvent(),
null))) {
+            loggingEventWrapper.setDisplayed(true);
+            updateEventMillisDelta(loggingEventWrapper, lastLoggingEventWrapper);
+            filteredList.add(loggingEventWrapper);
             rowAdded = true;
         } else {
-            e.setDisplayed(false);
+            loggingEventWrapper.setDisplayed(false);
         }
     }
 
-    checkForNewColumn(e);
+    checkForNewColumn(loggingEventWrapper);
 
     return rowAdded;
   }
 
-    private void updateEventMillisDelta(ExtendedLoggingEvent e, LoggingEvent lastEvent) {
-      if (lastEvent != null) {
-        e.setPreviousDisplayedEventTimestamp(lastEvent.getTimeStamp());
+    private void updateEventMillisDelta(LoggingEventWrapper loggingEventWrapper, LoggingEventWrapper
lastLoggingEventWrapper) {
+      if (lastLoggingEventWrapper != null) {
+        loggingEventWrapper.setPreviousDisplayedEventTimestamp(lastLoggingEventWrapper.getLoggingEvent().getTimeStamp());
       } else {
         //delta to same event = 0
-        e.setPreviousDisplayedEventTimestamp(e.getTimeStamp());
+        loggingEventWrapper.setPreviousDisplayedEventTimestamp(loggingEventWrapper.getLoggingEvent().getTimeStamp());
       }
     }
 
-   private void checkForNewColumn(ExtendedLoggingEvent e)
+   private void checkForNewColumn(LoggingEventWrapper loggingEventWrapper)
    {
       /**
        * Is this a new Property key we haven't seen before?  Remember that now MDC has been
merged
        * into the Properties collection
        */
-      boolean newColumn = uniquePropertyKeys.addAll(e.getPropertyKeySet());
+      boolean newColumn = uniquePropertyKeys.addAll(loggingEventWrapper.getPropertyKeySet());
 
       if (newColumn) {
         /**
          * If so, we should add them as columns and notify listeners.
          */
-        for (Iterator iter = e.getPropertyKeySet().iterator(); iter.hasNext();) {
+        for (Iterator iter = loggingEventWrapper.getPropertyKeySet().iterator(); iter.hasNext();)
{
           String key = iter.next().toString().toUpperCase();
 
           //add all keys except the 'log4jid' key (columnNames is all-caps)
@@ -670,7 +681,7 @@ class ChainsawCyclicBufferTableModel ext
             logger.debug("Adding col '" + key + "', columnNames=" + columnNames);
             fireNewKeyColumnAdded(
               new NewKeyEvent(
-                this, columnNames.indexOf(key), key, e.getProperty(key)));
+                this, columnNames.indexOf(key), key, loggingEventWrapper.getLoggingEvent().getProperty(key)));
           }
         }
       }
@@ -701,19 +712,19 @@ class ChainsawCyclicBufferTableModel ext
   }
 
     public void fireRowUpdated(int row, boolean checkForNewColumns) {
-        ExtendedLoggingEvent event = getRow(row);
-        if (event != null)
+        LoggingEventWrapper loggingEventWrapper = getRow(row);
+        if (loggingEventWrapper != null)
         {
-            event.updateColorRuleColors(colorizer.getBackgroundColor(event), colorizer.getForegroundColor(event));
+            loggingEventWrapper.updateColorRuleColors(colorizer.getBackgroundColor(loggingEventWrapper.getLoggingEvent()),
colorizer.getForegroundColor(loggingEventWrapper.getLoggingEvent()));
             Rule findRule = colorizer.getFindRule();
             if (findRule != null) {
-              event.evaluateSearchRule(colorizer.getFindRule());
+              loggingEventWrapper.evaluateSearchRule(colorizer.getFindRule());
             }
 
             fireTableRowsUpdated(row, row);
             if (checkForNewColumns) {
                 //row may have had a column added..if so, make sure a column is added
-                checkForNewColumn(event);
+                checkForNewColumn(loggingEventWrapper);
             }
         }
     }
@@ -844,13 +855,8 @@ class ChainsawCyclicBufferTableModel ext
 
                   for (Iterator iter = unfilteredList.iterator();
                       iter.hasNext();) {
-                    LoggingEvent e = (LoggingEvent) iter.next();
-                    newUnfilteredList.add(e);
-
-                    Object o =
-                      e.getProperty(
-                        e.getProperty(Constants.LOG4J_ID_KEY));
-
+                    LoggingEventWrapper loggingEventWrapper = (LoggingEventWrapper) iter.next();
+                    newUnfilteredList.add(loggingEventWrapper);
                     monitor.setProgress(index++);
                   }
 

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ColumnComparator.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ColumnComparator.java?rev=1022406&r1=1022405&r2=1022406&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ColumnComparator.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ColumnComparator.java Thu
Oct 14 08:01:36 2010
@@ -43,12 +43,12 @@ public class ColumnComparator implements
   public int compare(Object o1, Object o2) {
     int sort = 1;
 
-    if (o1 instanceof LoggingEvent && o2 instanceof LoggingEvent) {
+    if (o1 instanceof LoggingEventWrapper && o2 instanceof LoggingEventWrapper) {
 
 //		TODO not everything catered for here yet...
 
-      LoggingEvent e1 = (LoggingEvent) o1;
-      LoggingEvent e2 = (LoggingEvent) o2;
+      LoggingEvent e1 = ((LoggingEventWrapper) o1).getLoggingEvent();
+      LoggingEvent e2 = ((LoggingEventWrapper) o2).getLoggingEvent();
 
       switch (index + 1) {
       case ChainsawColumns.INDEX_LEVEL_COL_NAME:

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/CopyEventsToClipboardAction.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/CopyEventsToClipboardAction.java?rev=1022406&r1=1022405&r2=1022406&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/CopyEventsToClipboardAction.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/CopyEventsToClipboardAction.java
Thu Oct 14 08:01:36 2010
@@ -51,7 +51,7 @@ public class CopyEventsToClipboardAction
         List filteredEvents = logUi.getCurrentLogPanel().getFilteredEvents();
         StringBuffer writer = new StringBuffer(filteredEvents.size() * EVENTSIZE_FUDGE_FACTOR);
         for (Iterator iterator = filteredEvents.iterator(); iterator.hasNext();) {
-            LoggingEvent event = (LoggingEvent) iterator.next();
+            LoggingEvent event = ((LoggingEventWrapper) iterator.next()).getLoggingEvent();
             writer.append(layout.format(event));
         }
 

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/EventContainer.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/EventContainer.java?rev=1022406&r1=1022405&r2=1022406&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/EventContainer.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/EventContainer.java Thu
Oct 14 08:01:36 2010
@@ -21,7 +21,6 @@ import java.beans.PropertyChangeListener
 import java.util.List;
 
 import org.apache.log4j.rule.Rule;
-import org.apache.log4j.spi.LoggingEvent;
 
 
 /**
@@ -115,14 +114,14 @@ public interface EventContainer extends 
   /**
    * Returns the vector representing the row.
    */
-  ExtendedLoggingEvent getRow(int row);
+  LoggingEventWrapper getRow(int row);
 
   /**
    * Adds a row to the model.
    * @param e event
    * @return flag representing whether or not the row is being displayed (not filtered)
    */
-  boolean isAddRow(ExtendedLoggingEvent e);
+  boolean isAddRow(LoggingEventWrapper e);
 
   /**
    * Fire appropriate table update events for the range.
@@ -152,10 +151,10 @@ public interface EventContainer extends 
   void setDisplayRule(Rule displayRule);
 
   /**
-   * Returns the index of the LoggingEvent
-   * @param e
+   * Returns the index of the LoggingEventWrapper
+   * @param loggingEventWrapper
    */
-  int getRowIndex(LoggingEvent e);
+  int getRowIndex(LoggingEventWrapper loggingEventWrapper);
 
   /**
    * Remove property from all events in container

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileSaveAction.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileSaveAction.java?rev=1022406&r1=1022405&r2=1022406&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileSaveAction.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileSaveAction.java Thu
Oct 14 08:01:36 2010
@@ -41,7 +41,6 @@ import javax.swing.KeyStroke;
 
 import org.apache.log4j.chainsaw.icons.ChainsawIcons;
 import org.apache.log4j.helpers.LogLog;
-import org.apache.log4j.spi.LoggingEvent;
 import org.apache.log4j.xml.XMLLayout;
 
 
@@ -117,9 +116,9 @@ class FileSaveAction extends AbstractAct
       }
       Iterator iter = v.iterator();
       while (iter.hasNext()) {
-        LoggingEvent event = (LoggingEvent) iter.next();
-        layout.setLocationInfo(event.getThrowableInformation() != null);
-        writer.write(layout.format(event));
+        LoggingEventWrapper loggingEventWrapper = (LoggingEventWrapper) iter.next();
+        layout.setLocationInfo(loggingEventWrapper.getLoggingEvent().getThrowableInformation()
!= null);
+        writer.write(layout.format(loggingEventWrapper.getLoggingEvent()));
       }
     } catch (IOException ioe) {
       LogLog.warn("Unable to save file", ioe);

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/JSortTable.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/JSortTable.java?rev=1022406&r1=1022405&r2=1022406&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/JSortTable.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/JSortTable.java Thu Oct
14 08:01:36 2010
@@ -22,7 +22,6 @@ import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 
 import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
 import javax.swing.table.JTableHeader;
 import javax.swing.table.TableColumnModel;
 
@@ -43,27 +42,11 @@ public class JSortTable extends JTable i
   private String sortedColumn;
   private int lastSelectedColumn = -1;
 
-  public JSortTable() {
-    super();
-    initSortHeader();
-  }
   public JSortTable(SortTableModel model) {
     super(model);
     initSortHeader();
   }
 
-  public JSortTable(SortTableModel model, TableColumnModel colModel) {
-    super(model, colModel);
-    initSortHeader();
-  }
-
-  public JSortTable(
-    SortTableModel model, TableColumnModel colModel,
-    ListSelectionModel selModel) {
-    super(model, colModel, selModel);
-    initSortHeader();
-  }
-
   public void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)
{
     //selection of the msg field causes rendering to flash...skip over it
     int colToSelect = columnIndex;
@@ -108,7 +91,7 @@ public class JSortTable extends JTable i
   }
 
   //Allow synchronous updates if already on the EDT
-  public void scrollTo(final int row, final int col) {
+  private void scrollTo(final int row, final int col) {
     final int currentRow = getSelectedRow();
     SwingHelper.invokeOnEDT(new Runnable() {
       public void run() {



Mime
View raw message