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("" + result.toString() + ""); } - Map map = new HashMap(); - map.put(ruleSet, list); - - colorizer.setRules(map); } JPanel buildClosePanel() {