logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r826975 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java java/org/apache/log4j/chainsaw/LogPanel.java resources/org/apache/log4j/chainsaw/prefs/default.properties
Date Tue, 20 Oct 2009 06:43:27 GMT
Author: sdeboy
Date: Tue Oct 20 06:43:27 2009
New Revision: 826975

URL: http://svn.apache.org/viewvc?rev=826975&view=rev
Log:
Fix 'set refine focus' and 'find next' - mixed-case col names weren't matching

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
    logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties

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=826975&r1=826974&r2=826975&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
Tue Oct 20 06:43:27 2009
@@ -338,9 +338,7 @@
   }
 
   public String getColumnName(int column) {
-      //columnNames all upper, make 1st char upper & rest lower
-      String col = (String) columnNames.get(column);
-      return col.substring(0, 1).toUpperCase() + col.substring(1).toLowerCase();
+      return (String) columnNames.get(column);
   }
 
   public LoggingEvent getRow(int row) {
@@ -506,10 +504,9 @@
         if (!columnNames.contains(key) && !(Constants.LOG4J_ID_KEY.equalsIgnoreCase(key)))
{
           columnNames.add(key);
           logger.debug("Adding col '" + key + "', columnNames=" + columnNames);
-          String mixedCaseKey = key.substring(0, 1).toUpperCase() + key.substring(1).toLowerCase();
           fireNewKeyColumnAdded(
             new NewKeyEvent(
-              this, columnNames.indexOf(key), mixedCaseKey, e.getProperty(key)));
+              this, columnNames.indexOf(key), key, e.getProperty(key)));
         }
       }
     }

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java?rev=826975&r1=826974&r2=826975&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java Tue Oct 20
06:43:27 2009
@@ -1234,7 +1234,7 @@
             String operator = "==";
             int column = table.columnAtPoint(currentPoint);
             int row = table.rowAtPoint(currentPoint);
-            String colName = table.getColumnName(column);
+            String colName = table.getColumnName(column).toUpperCase();
             String value = "";
 
             if (colName.equalsIgnoreCase(ChainsawConstants.TIMESTAMP_COL_NAME)) {
@@ -1270,7 +1270,7 @@
             String operator = "==";
             int column = table.columnAtPoint(currentPoint);
             int row = table.rowAtPoint(currentPoint);
-            String colName = table.getColumnName(column);
+            String colName = table.getColumnName(column).toUpperCase();
             String value = "";
 
             if (colName.equalsIgnoreCase(ChainsawConstants.TIMESTAMP_COL_NAME)) {
@@ -1345,7 +1345,7 @@
             String operator = "~=";
             int column = table.columnAtPoint(currentPoint);
             int row = table.rowAtPoint(currentPoint);
-            String colName = table.getColumnName(column);
+            String colName = table.getColumnName(column).toUpperCase();
             String value = "";
 
             if (colName.equalsIgnoreCase(ChainsawConstants.TIMESTAMP_COL_NAME)) {
@@ -1554,7 +1554,7 @@
                 int index = 0;
                 StringTokenizer tok = new StringTokenizer(columnOrder, ",");
                 while (tok.hasMoreElements()) {
-                  String element = tok.nextElement().toString().trim();
+                  String element = tok.nextElement().toString().trim().toUpperCase();
                   TableColumn column = new TableColumn(index++);
                   column.setHeaderValue(element);
                   preferenceModel.addColumn(column);
@@ -2336,7 +2336,7 @@
     Map columnNameMap = new HashMap();
 
     for (int i = 0; i < columnModel.getColumnCount(); i++) {
-      columnNameMap.put(table.getColumnName(i), columnModel.getColumn(i));
+      columnNameMap.put(table.getColumnName(i).toUpperCase(), columnModel.getColumn(i));
     }
 
     int index = 0;
@@ -2349,7 +2349,7 @@
        (may be a subset of possible columns)
      **/
     while (tok.hasMoreElements()) {
-      String element = (String) tok.nextElement();
+      String element = tok.nextElement().toString().trim().toUpperCase();
       TableColumn column = (TableColumn) columnNameMap.get(element);
 
       if (column != null) {

Modified: logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties?rev=826975&r1=826974&r2=826975&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties
(original)
+++ logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties
Tue Oct 20 06:43:27 2009
@@ -9,8 +9,7 @@
 main.window.width=640
 main.window.height=480
 
-#entries need to have 1st char uppercase, remaining lowercase
-table.columns.order=Id,Timestamp,Level,Logger,Message,Throwable,Thread,Ndc,Class,Method,File,Line
+table.columns.order=ID,TIMESTAMP,LEVEL,LOGGER,MESSAGE,THROWABLE,THREAD,NDC,CLASS,METHOD,FILE,LINE
 table.columns.widths=50,150,50,100,300,100,150,150,300,150,100,100
 
 SavedConfigs.Size=0



Mime
View raw message