logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r673734 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/color/ColorPanel.java
Date Thu, 03 Jul 2008 16:27:26 GMT
Author: sdeboy
Date: Thu Jul  3 09:27:26 2008
New Revision: 673734

URL: http://svn.apache.org/viewvc?rev=673734&view=rev
Log:
Entering an invalid expression in color filter panel caused entry with invalid expression
to be removed when apply was pressed.  

Don't apply color filters until all expressions are valid.

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/color/ColorPanel.java

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/color/ColorPanel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/color/ColorPanel.java?rev=673734&r1=673733&r2=673734&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/color/ColorPanel.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/color/ColorPanel.java Thu
Jul  3 09:27:26 2008
@@ -346,19 +346,22 @@
       }
     }
 
+    //all rules are valid, they can be applied
     if (result.toString().equals("")) {
       ((ExpressionTableCellRenderer) table.getColumnModel().getColumn(0).getCellRenderer())
       .setToolTipText("Double click to edit");
       statusBar.setText("");
+
+      //only update rules if there were no errors
+      Map map = new HashMap();
+      map.put(ruleSet, list);
+      colorizer.setRules(map);
+
     } else {
-      statusBar.setText("Errors - see expression tooltip");
+      statusBar.setText("Errors - see expression tooltip (color filters won't be active until
errors are resolved)");
       ((ExpressionTableCellRenderer) table.getColumnModel().getColumn(0).getCellRenderer())
       .setToolTipText("<html>" + result.toString() + "</html>");
     }
-    Map map = new HashMap();
-    map.put(ruleSet, list);
-
-    colorizer.setRules(map);
   }
 
   JPanel buildClosePanel() {



Mime
View raw message