logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r925702 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/ java/org/apache/log4j/chainsaw/color/ resources/org/apache/log4j/chainsaw/ resources/org/apache/log4j/chainsaw/help/
Date Sat, 20 Mar 2010 23:58:37 GMT
Author: sdeboy
Date: Sat Mar 20 23:58:36 2010
New Revision: 925702

URL: http://svn.apache.org/viewvc?rev=925702&view=rev
Log:
Chainsaw enhancements
 - New color rule: any row with a value in the 'log4j.marker' field will display as light
green
 - Added keyboard mnemonics to search field (alt-j) and refine focus field (alt-k), added
shortcuts to Welcome page
 - Fixed some minor layout glitches
 - updated release notes

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/color/RuleColorizer.java
    logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/WelcomePanel.html
    logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java?rev=925702&r1=925701&r2=925702&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java
Sat Mar 20 23:58:36 2010
@@ -20,6 +20,7 @@ package org.apache.log4j.chainsaw;
 import java.awt.BorderLayout;
 import java.awt.Component;
 import java.awt.Dimension;
+import java.awt.Font;
 import java.awt.Insets;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -35,6 +36,7 @@ import java.util.List;
 import javax.swing.AbstractAction;
 import javax.swing.Action;
 import javax.swing.Box;
+import javax.swing.BoxLayout;
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
 import javax.swing.JCheckBoxMenuItem;
@@ -147,18 +149,20 @@ class ChainsawToolBarAndMenus implements
     showReceiversButton = new SmallToggleButton(showReceiversAction);
 
     findPanel = new JPanel();
+    findPanel.setLayout(new BoxLayout(findPanel, BoxLayout.X_AXIS));
 
-    Dimension findSize = new Dimension(170, 22);
-    Dimension findPanelSize = new Dimension(175, 30);
+    Dimension findSize = new Dimension(260, 22);
+    Dimension findPanelSize = new Dimension(310, 30);
     findPanel.setPreferredSize(findPanelSize);
     findPanel.setMaximumSize(findPanelSize);
     findPanel.setMinimumSize(findPanelSize);
+
     findField.setPreferredSize(findSize);
     findField.setMaximumSize(findSize);
     findField.setMinimumSize(findSize);
     findPanel.setAlignmentY(Component.CENTER_ALIGNMENT);
     findField.setAlignmentY(Component.CENTER_ALIGNMENT);
-    
+
     toggleDetailPaneAction = createToggleDetailPaneAction();
     createMenuBar();
     createToolbar();
@@ -822,9 +826,18 @@ class ChainsawToolBarAndMenus implements
       (KeyStroke) findPreviousAction.getValue(Action.ACCELERATOR_KEY),
       findPreviousAction.getValue(Action.NAME));
 
+    JLabel searchLabel = new JLabel("Search:");
+    searchLabel.setDisplayedMnemonic('j');
+    searchLabel.setFont(searchLabel.getFont().deriveFont(Font.BOLD));
+    findPanel.add(searchLabel);
+    findPanel.add(Box.createHorizontalStrut(3));
     findPanel.add(findField);
+    findPanel.add(Box.createRigidArea(new Dimension(5, 0)));
+    searchLabel.setLabelFor(findField);
+
 
     toolbar.add(findPanel);
+    toolbar.addSeparator(new Dimension(7, 5));
     toolbar.add(findNextButton);
     toolbar.add(findPreviousButton);
 
@@ -887,7 +900,15 @@ class ChainsawToolBarAndMenus implements
       activateLogPanelActions = false;
       findField.setEnabled(false);
       findPanel.removeAll();
+      JLabel searchLabel = new JLabel("Search:");
+      searchLabel.setDisplayedMnemonic('j');
+      searchLabel.setFont(searchLabel.getFont().deriveFont(Font.BOLD));
+      findPanel.add(searchLabel);
+      findPanel.add(Box.createHorizontalStrut(3));
+
       findPanel.add(findField);
+      findPanel.add(Box.createRigidArea(new Dimension(5, 0)));
+      searchLabel.setLabelFor(findField);
       activeTabMenu.setEnabled(false);
       closeAction.setEnabled(true);
       detailPaneButton.setSelected(false);
@@ -896,7 +917,15 @@ class ChainsawToolBarAndMenus implements
       activeTabMenu.setEnabled(true);
       fileMenu.getFileSaveAction().setEnabled(true);
       findPanel.removeAll();
+      JLabel searchLabel = new JLabel("Search:");
+      searchLabel.setDisplayedMnemonic('j');
+
+      searchLabel.setFont(searchLabel.getFont().deriveFont(Font.BOLD));
+      findPanel.add(searchLabel);
+      findPanel.add(Box.createHorizontalStrut(3));
       findPanel.add(logPanel.getFindTextField());
+      findPanel.add(Box.createRigidArea(new Dimension(5, 0)));
+      searchLabel.setLabelFor(logPanel.getFindTextField());
 
       pauseButton.getModel().setSelected(logPanel.isPaused());
       toggleCyclicButton.setSelected(logPanel.isCyclic());

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=925702&r1=925701&r2=925702&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 Sat Mar 20
23:58:36 2010
@@ -263,6 +263,11 @@ public class LogPanel extends DockablePa
 
     setLayout(new BorderLayout());
     findPanel = new JPanel();
+    findPanel.setLayout(new BoxLayout(findPanel, BoxLayout.X_AXIS));
+    Dimension findPanelSize = new Dimension(310, 30);
+    findPanel.setPreferredSize(findPanelSize);
+    findPanel.setMaximumSize(findPanelSize);
+    findPanel.setMinimumSize(findPanelSize);
 
     final Map columnNameKeywordMap = new HashMap();
     columnNameKeywordMap.put(
@@ -939,9 +944,13 @@ public class LogPanel extends DockablePa
 
     final JLabel filterLabel = new JLabel("Refine focus on: ");
     filterLabel.setFont(filterLabel.getFont().deriveFont(Font.BOLD));
+    filterLabel.setDisplayedMnemonic('k');
+
+    JPanel upperLeftPanel = new JPanel();
+    upperLeftPanel.setLayout(new BoxLayout(upperLeftPanel, BoxLayout.X_AXIS));
+    upperLeftPanel.setAlignmentY(Component.CENTER_ALIGNMENT);
+    upperLeftPanel.setAlignmentY(Component.CENTER_ALIGNMENT);
 
-    JPanel upperLeftPanel =
-      new JPanel(new FlowLayout(FlowLayout.CENTER, 3, 0));
     upperLeftPanel.add(filterLabel);
 
     //hold a reference to the combobox model so that we can check to prevent duplicates
@@ -993,6 +1002,7 @@ public class LogPanel extends DockablePa
           }
         });
       upperPanel.add(filterCombo, BorderLayout.CENTER);
+      filterLabel.setLabelFor(filterCombo);
     } else {
       filterText = new JTextField();
       filterText.setToolTipText("Enter an expression");
@@ -1862,7 +1872,17 @@ public class LogPanel extends DockablePa
     setDocked(false);
     externalPanel.removeAll();
     findPanel.removeAll();
+
+    JLabel searchLabel = new JLabel("Search:");
+    searchLabel.setDisplayedMnemonic('j');
+
+    searchLabel.setFont(searchLabel.getFont().deriveFont(Font.BOLD));
+    findPanel.add(searchLabel);
+    findPanel.add(Box.createHorizontalStrut(3));
+
     findPanel.add(findField);
+    findPanel.add(Box.createRigidArea(new Dimension(5, 0)));
+    searchLabel.setLabelFor(findField);
 
     externalPanel.add(undockedToolbar, BorderLayout.NORTH);
     externalPanel.add(nameTreeAndMainPanelSplit, BorderLayout.CENTER);
@@ -2163,6 +2183,13 @@ public class LogPanel extends DockablePa
       toolbar.addSeparator();
     
     findField = new JTextField();
+    Dimension findSize = new Dimension(260, 22);
+    findField.setPreferredSize(findSize);
+    findField.setMaximumSize(findSize);
+    findField.setMinimumSize(findSize);
+    findPanel.setAlignmentY(Component.CENTER_ALIGNMENT);
+    findField.setAlignmentY(Component.CENTER_ALIGNMENT);
+
     findField.addKeyListener(
       new ExpressionRuleContext(filterModel, findField));
 
@@ -2218,8 +2245,7 @@ public class LogPanel extends DockablePa
       KeyStroke.getKeyStroke(KeyEvent.VK_F3, InputEvent.SHIFT_MASK),
       undockedFindPreviousAction.getValue(Action.NAME));
 
-    Dimension findSize = new Dimension(170, 22);
-    Dimension findPanelSize = new Dimension(175, 30);
+    Dimension findPanelSize = new Dimension(310, 30);
     findPanel.setPreferredSize(findPanelSize);
     findPanel.setMaximumSize(findPanelSize);
     findPanel.setMinimumSize(findPanelSize);
@@ -2230,6 +2256,8 @@ public class LogPanel extends DockablePa
     findField.setAlignmentY(Component.CENTER_ALIGNMENT);
     
     toolbar.add(findPanel);
+    toolbar.addSeparator(new Dimension(7, 5));
+      
     toolbar.add(undockedFindNextButton);
     toolbar.add(undockedFindPreviousButton);
 

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/color/RuleColorizer.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/color/RuleColorizer.java?rev=925702&r1=925701&r2=925702&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/color/RuleColorizer.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/color/RuleColorizer.java
Sat Mar 20 23:58:36 2010
@@ -65,6 +65,13 @@ public class RuleColorizer implements Co
       new ColorRule(
         expression, ExpressionRule.getRule(expression), new Color(255, 255, 153),
         Color.black));
+
+      expression = "prop.log4j.marker exists";
+      rulesList.add(
+        new ColorRule(
+          expression, ExpressionRule.getRule(expression), new Color(153, 255, 153),
+          Color.black));
+
     defaultRules.put(DEFAULT_NAME, rulesList);
     setRules(defaultRules);
   }

Modified: logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/WelcomePanel.html
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/WelcomePanel.html?rev=925702&r1=925701&r2=925702&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/WelcomePanel.html
(original)
+++ logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/WelcomePanel.html
Sat Mar 20 23:58:36 2010
@@ -44,6 +44,30 @@
     <td>Scroll to bottom</td>
 </tr>
 <tr valign="top" bgcolor="#EEEEEE">
+    <td nowrap class="HotKey">Ctrl-F2 (or double-click on a row)</td>
+    <td width="50" align="center">-</td>
+    <td colspan="1">Define a 'marker' (add a note to a row)</td>
+    <td nowrap class="HotKey">F2</td>
+    <td width="50" align="center">-</td>
+    <td colspan="1">Find next marker</td>
+</tr>
+<tr valign="top" bgcolor="#EEEEEE">
+    <td nowrap class="HotKey">Shift-F2</td>
+    <td width="50" align="center">-</td>
+    <td colspan="1">Find previous marker</td>
+    <td nowrap class="HotKey">Ctrl-shift-F2</td>
+    <td width="50" align="center">-</td>
+    <td colspan="1">Clear all markers</td>
+</tr>
+<tr valign="top">
+    <td nowrap class="HotKey">ALT-J</td>
+    <td width="50" align="center">-</td>
+    <td>Set focus in 'search' field</td>
+    <td nowrap class="HotKey">ALT-K</td>
+    <td width="50" align="center">-</td>
+    <td>Set focus in 'refine focus' field</td>
+</tr>
+<tr valign="top" bgcolor="#EEEEEE">
 	<td nowrap class="HotKey">CTRL-RIGHT</td>
 	<td width="50" align="center">-</td>
 	<td>Activate a tab to the right</td>
@@ -96,22 +120,6 @@
     <td width="50" align="center">-</td>
     <td colspan="1">Go to line</td>
 </tr>
-    <tr valign="top" bgcolor="#EEEEEE">
-        <td nowrap class="HotKey">Ctrl-F2 (or double-click on a row)</td>
-        <td width="50" align="center">-</td>
-        <td colspan="1">Define a 'marker' (add a note to a row)</td>
-        <td nowrap class="HotKey">F2</td>
-        <td width="50" align="center">-</td>
-        <td colspan="1">Find next marker</td>
-    </tr>
-    <tr valign="top" bgcolor="#EEEEEE">
-        <td nowrap class="HotKey">Shift-F2</td>
-        <td width="50" align="center">-</td>
-        <td colspan="1">Find previous marker</td>
-        <td nowrap class="HotKey">Ctrl-shift-F2</td>
-        <td width="50" align="center">-</td>
-        <td colspan="1">Clear all markers</td>
-    </tr>
 </table></P>
 <!--<p><a href="#TheTop">Back to top</a></p>-->
 <a name="Receivers"></a>

Modified: logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html?rev=925702&r1=925701&r2=925702&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html
(original)
+++ logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html
Sat Mar 20 23:58:36 2010
@@ -10,6 +10,14 @@
 <b>NOTE:</b> The mechanism and format used to persist settings in Chainsaw is
subject to change.  If you are experiencing problems displaying events in Chainsaw, please
delete everything in the $user.dir/.chainsaw directory and restart Chainsaw.
 <br>
 <h1>1.99.99</h1>
+<h2>20 Mar 2010</h2>
+<ul>
+<li>
+New color rule: any row with a value in the 'log4j.marker' field will display as light green
+</li>
+<li>
+Added keyboard mnemonics to search field (alt-j) and refine focus field (alt-k), added shortcuts
to Welcome page</li>
+</ul>
 <h2>16 Mar 2010</h2>
 <ul>
 <li>



Mime
View raw message