logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r1026945 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/ java/org/apache/log4j/chainsaw/color/ resources/org/apache/log4j/chainsaw/help/
Date Mon, 25 Oct 2010 05:00:04 GMT
Author: sdeboy
Date: Mon Oct 25 05:00:03 2010
New Revision: 1026945

URL: http://svn.apache.org/viewvc?rev=1026945&view=rev
Log:
Replace 'search' in the UI with 'find'
Syncing addition & removal of entries in the refine focus & find combo boxes

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawStatusBar.java
    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/LogPanelPreferencePanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/color/ColorPanel.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/help/tutorial.html

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawStatusBar.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawStatusBar.java?rev=1026945&r1=1026944&r2=1026945&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawStatusBar.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawStatusBar.java
Mon Oct 25 05:00:03 2010
@@ -104,7 +104,7 @@ public class ChainsawStatusBar extends J
     searchMatchLabel.setToolTipText("<# viewable events>:<# total events>");
     searchMatchLabel.setMinimumSize(
     new Dimension(
-    searchMatchLabel.getFontMetrics(eventCountLabel.getFont()).stringWidth("Search matches:
999999999999") + 5,
+    searchMatchLabel.getFontMetrics(eventCountLabel.getFont()).stringWidth("Find matches:
999999999999") + 5,
             (int) searchMatchLabel.getPreferredSize().getHeight()));
 
     receivedConnectionlabel.setBorder(statusBarComponentBorder);
@@ -273,7 +273,7 @@ public class ChainsawStatusBar extends J
           if (searchMatchCount == 0) {
             searchMatchLabel.setText("");
           } else {
-            searchMatchLabel.setText("Search matches: " + searchMatchCount);
+            searchMatchLabel.setText("Find matches: " + searchMatchCount);
           }
       }
   }

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=1026945&r1=1026944&r2=1026945&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
Mon Oct 25 05:00:03 2010
@@ -274,7 +274,7 @@ class ChainsawToolBarAndMenus implements
            }
          };
 
-       action.putValue(Action.SHORT_DESCRIPTION, "Searches for the next marker from the current
location");
+       action.putValue(Action.SHORT_DESCRIPTION, "Find the next marker from the current location");
        action.putValue("enabled", Boolean.TRUE);
        action.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_N));
        action.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("F2"));
@@ -292,7 +292,7 @@ class ChainsawToolBarAndMenus implements
           }
         };
 
-      action.putValue(Action.SHORT_DESCRIPTION, "Searches for the previous marker from the
current location");
+      action.putValue(Action.SHORT_DESCRIPTION, "Find the previous marker from the current
location");
       action.putValue("enabled", Boolean.TRUE);
       action.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_P));
       action.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F2,  InputEvent.SHIFT_MASK));
@@ -892,7 +892,7 @@ class ChainsawToolBarAndMenus implements
             }
           }
         };
-        action.putValue(Action.SHORT_DESCRIPTION, "Searches for the next colorized event
from the current location");
+        action.putValue(Action.SHORT_DESCRIPTION, "Find the next colorized event from the
current location");
         action.putValue("enabled", Boolean.TRUE);
         action.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_N));
         action.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_N, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
@@ -911,7 +911,7 @@ class ChainsawToolBarAndMenus implements
             }
           }
         };
-        action.putValue(Action.SHORT_DESCRIPTION, "Searches for the next colorized event
from the current location");
+        action.putValue(Action.SHORT_DESCRIPTION, "Find the next colorized event from the
current location");
         action.putValue("enabled", Boolean.TRUE);
         action.putValue(Action.MNEMONIC_KEY, new Integer(KeyEvent.VK_P));
         action.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_P, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));

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=1026945&r1=1026944&r2=1026945&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 Mon Oct 25
05:00:03 2010
@@ -79,6 +79,7 @@ import javax.swing.Box;
 import javax.swing.BoxLayout;
 import javax.swing.ButtonGroup;
 import javax.swing.ComboBoxEditor;
+import javax.swing.ComboBoxModel;
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
 import javax.swing.JCheckBoxMenuItem;
@@ -288,12 +289,13 @@ public class LogPanel extends DockablePa
     String prototypeValue = "1231231231231231231231";
 
     filterCombo = new AutoFilterComboBox();
+    findCombo = new AutoFilterComboBox();
+
     filterCombo.setPrototypeDisplayValue(prototypeValue);
-    buildCombo(filterCombo, true);
+    buildCombo(filterCombo, true, findCombo.model);
 
-    findCombo = new AutoFilterComboBox();
     findCombo.setPrototypeDisplayValue(prototypeValue);
-    buildCombo(findCombo, false);
+    buildCombo(findCombo, false, filterCombo.model);
 
     final Map columnNameKeywordMap = new HashMap();
     columnNameKeywordMap.put(ChainsawConstants.CLASS_COL_NAME, LoggingEventFieldResolver.CLASS_FIELD);
@@ -1105,20 +1107,28 @@ public class LogPanel extends DockablePa
     upperPanel.add(filterCombo);
     upperPanel.add(Box.createHorizontalStrut(3));
 
+    final JTextField filterText =(JTextField) filterCombo.getEditor().getEditorComponent();
+    final JTextField findText =(JTextField) findCombo.getEditor().getEditorComponent();
+
+
     //Adding a button to clear filter expressions which are currently remembered by Chainsaw...
     final JButton removeFilterButton = new JButton(" Remove ");
-    final JTextField filterText =(JTextField) filterCombo.getEditor().getEditorComponent();
+
     removeFilterButton.setToolTipText("Click here to remove the selected expression from
the list");
     removeFilterButton.addActionListener(
             new AbstractAction() {
                 public void actionPerformed(ActionEvent e){
                 	Object selectedItem = filterCombo.getSelectedItem();
                     if (e.getSource() == removeFilterButton && selectedItem != null
&& !selectedItem.toString().trim().equals("")){
-                        //don't just remove the entry from the store, clear the field
-                        int index = filterCombo.getSelectedIndex();
-                        filterText.setText(null);
-                        filterCombo.setSelectedIndex(-1);
-                        filterCombo.removeItemAt(index);
+                      //don't just remove the entry from the store, clear the field
+                      int index = filterCombo.getSelectedIndex();
+                      filterText.setText(null);
+                      filterCombo.setSelectedIndex(-1);
+                      filterCombo.removeItemAt(index);
+                      if (!(findCombo.getSelectedItem() != null && findCombo.getSelectedItem().equals(selectedItem)))
{
+                        //now remove the entry from the other model
+                        ((AutoFilterComboBox.AutoFilterComboBoxModel)findCombo.getModel()).removeElement(selectedItem);
+                      }
                     }
                 }
             }
@@ -1162,18 +1172,21 @@ public class LogPanel extends DockablePa
     
     //Adding a button to clear filter expressions which are currently remembered by Chainsaw...
     final JButton removeFindButton = new JButton(" Remove ");
-    final JTextField findText =(JTextField) findCombo.getEditor().getEditorComponent();
     removeFindButton.setToolTipText("Click here to remove the selected expression from the
list");
     removeFindButton.addActionListener(
             new AbstractAction() {
                 public void actionPerformed(ActionEvent e){
                 	Object selectedItem = findCombo.getSelectedItem();
                     if (e.getSource() == removeFindButton && selectedItem != null
&& !selectedItem.toString().trim().equals("")){
-                        //don't just remove the entry from the store, clear the field
-                        int index = findCombo.getSelectedIndex();
-                        findText.setText(null);
-                        findCombo.setSelectedIndex(-1);
-                        findCombo.removeItemAt(index);
+                      //don't just remove the entry from the store, clear the field
+                      int index = findCombo.getSelectedIndex();
+                      findText.setText(null);
+                      findCombo.setSelectedIndex(-1);
+                      findCombo.removeItemAt(index);
+                      if (!(filterCombo.getSelectedItem() != null && filterCombo.getSelectedItem().equals(selectedItem)))
{
+                        //now remove the entry from the other model if it wasn't selected
+                        ((AutoFilterComboBox.AutoFilterComboBoxModel)filterCombo.getModel()).removeElement(selectedItem);
+                      }
                     }
                 }
             }
@@ -1796,7 +1809,7 @@ public class LogPanel extends DockablePa
 
      class ClearSearch extends AbstractAction {
        public ClearSearch() {
-         super("Clear search field");
+         super("Clear find field");
        }
           public void actionPerformed(ActionEvent e) {
             findCombo.setSelectedItem(null);
@@ -1959,7 +1972,7 @@ public class LogPanel extends DockablePa
     return action;
   }
 
-  private  void buildCombo(final JComboBox combo, boolean isFiltering) {
+  private  void buildCombo(final AutoFilterComboBox combo, boolean isFiltering, final AutoFilterComboBox.AutoFilterComboBoxModel
otherModel) {
     //add (hopefully useful) default filters
     combo.addItem("LEVEL == TRACE");
     combo.addItem("LEVEL >= DEBUG");
@@ -1987,6 +2000,7 @@ public class LogPanel extends DockablePa
                     ExpressionRule.getRule(item.toString());
                     //add entry as first row of the combo box
                     combo.insertItemAt(item, 0);
+                    otherModel.insertElementAt(item, 0);
                   }
                 //valid expression, reset background color in case we were previously an
invalid expression
                 filterText.setBackground(UIManager.getColor("TextField.background"));

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java?rev=1026945&r1=1026944&r2=1026945&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanelPreferencePanel.java
Mon Oct 25 05:00:03 2010
@@ -531,8 +531,8 @@ public class LogPanelPreferencePanel ext
     private final JCheckBox loggerTreePanel =
       new JCheckBox("Show Logger Tree");
     private final JCheckBox wrapMessage = new JCheckBox("Wrap message field (display multi-line
rows) ");
-    private final JCheckBox searchResultsVisible = new JCheckBox("Display search results
in details panel ");
-    private final JCheckBox highlightSearchMatchText = new JCheckBox("Highlight search match
text ");
+    private final JCheckBox searchResultsVisible = new JCheckBox("Display find results in
details panel ");
+    private final JCheckBox highlightSearchMatchText = new JCheckBox("Highlight find match
text ");
     private final JCheckBox scrollToBottom =
       new JCheckBox("Scroll to bottom (view tracks with new events)");
     private final JCheckBox showMillisDeltaAsGap =

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java?rev=1026945&r1=1026944&r2=1026945&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java
Mon Oct 25 05:00:03 2010
@@ -829,7 +829,7 @@ final class LoggerNameTreePanel extends 
       action.putValue(Action.NAME, "Find next");
       action.putValue(
         Action.SHORT_DESCRIPTION,
-        "Search using the selected node");
+        "Find using the selected node");
       action.setEnabled(false);
 
       return action;
@@ -941,10 +941,10 @@ final class LoggerNameTreePanel extends 
           }
         };
 
-      action.putValue(Action.NAME, "Clear search field");
+      action.putValue(Action.NAME, "Clear find field");
       action.putValue(
         Action.SHORT_DESCRIPTION,
-        "Clear the search field");
+        "Clear the find field");
       action.setEnabled(false);
 
       return action;
@@ -1238,7 +1238,7 @@ final class LoggerNameTreePanel extends 
     {
       focusOnAction.putValue(Action.NAME, "Focus On...");
       hideAction.putValue(Action.NAME, "Ignore...");
-      findNextAction.putValue(Action.NAME, "Search for...");
+      findNextAction.putValue(Action.NAME, "Find...");
       setRefineFocusAction.putValue(Action.NAME, "Set refine focus field");
       updateRefineFocusAction.putValue(Action.NAME, "Add to refine focus field");
       defineColorRuleForLoggerAction.putValue(Action.NAME, "Define color rule");
@@ -1247,7 +1247,7 @@ final class LoggerNameTreePanel extends 
     {
       focusOnAction.putValue(Action.NAME, "Focus On '" + logger + "'");
       hideAction.putValue(Action.NAME, "Ignore '" + logger + "'");
-      findNextAction.putValue(Action.NAME, "Search for '" + logger + "'");
+      findNextAction.putValue(Action.NAME, "Find '" + logger + "'");
       setRefineFocusAction.putValue(Action.NAME, "Set refine focus field to '" + logger +
"'");
       updateRefineFocusAction.putValue(Action.NAME, "Add '" + logger + "' to 'refine focus'
field");
       defineColorRuleForLoggerAction.putValue(Action.NAME, "Define color rule for '" + logger
+ "'");

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=1026945&r1=1026944&r2=1026945&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 Mon
Oct 25 05:00:03 2010
@@ -303,7 +303,7 @@ public class ColorPanel extends JPanel
       JPanel panel = new JPanel();
       panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
 
-      JLabel defineSearchColorsLabel = new JLabel("Search colors");
+      JLabel defineSearchColorsLabel = new JLabel("Find colors");
 
       panel.add(defineSearchColorsLabel);
 

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=1026945&r1=1026944&r2=1026945&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
Mon Oct 25 05:00:03 2010
@@ -17,7 +17,7 @@
 </ul>
 <h2>13 Oct 2010</h2>
 <ul>
-<li>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.</li>
+<li>Added log panel preference to display find 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.</li>
 </ul>
 <h2>22 Sep 2010</h2>
 <ul>
@@ -25,9 +25,9 @@
 </ul>
 <h2>15 Sep 2010</h2>
 <ul>
-<li>New feature: Clickable thumbnail bar on the left shows time delta to prior displayed
event if the time delta is > 1 second (behaves similarly to the thumbnail bar on the right
which shows colors and search matches, but represents the time delta between events).  A bigger
delta is represented as a wider line.</li>
+<li>New feature: Clickable thumbnail bar on the left shows time delta to prior displayed
event if the time delta is > 1 second (behaves similarly to the thumbnail bar on the right
which shows colors and find matches, but represents the time delta between events).  A bigger
delta is represented as a wider line.</li>
 <li>Updated table rendering logic when in line-wrap mode</li>
-<li>Updated row selection logic (goto/search) to make sure event is on the screen</li>
+<li>Updated row selection logic (goto/find) to make sure event is on the screen</li>
 <li>Capped the event time delta rendering in the table to a max of 50 pixels tall</li>
 </ul>
 <h2>13 Sep 2010</h2>

Modified: logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/tutorial.html
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/tutorial.html?rev=1026945&r1=1026944&r2=1026945&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/tutorial.html
(original)
+++ logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/tutorial.html
Mon Oct 25 05:00:03 2010
@@ -216,16 +216,16 @@ Example: to display only events which ar
 <tr><td>To display events occurring at 23:55:12 on the 19th of June (all events
generated during that second, regardless of millisecond value)</td><td><b>TIMESTAMP
== '2004/06/19 23:55:12'</b></td></tr>
 </table>
 
-<A NAME="search"><h3>Search</h3>
+<A NAME="search"><h3>Find</h3>
 <p>
-<b>How to search:</b></p>
+<b>How to find:</b></p>
 <ul>
-<li><b>Enter an expression</b> in the text field of the main Chainsaw toolbar
(a log panel must be selected)</li>
-<li>Click the <b>down arrow icon</b> or press <b>F3</b> to
search forward</li>
-<li>Click the <b>up arrow icon</b> or press <b>Shift+F3</b>
to search backward</li>
+<li><b>Enter an expression</b> in the Find field</li>
+<li>Click the <b>down arrow icon</b> or press <b>F3</b> or
<b>enter</b> to search forward from the currently selected row</li>
+<li>Click the <b>up arrow icon</b> or press <b>Shift+F3</b>
to search backward from the currently selected row</li>
 <li>The first matching row becomes selected, with matching rows displayed with white
text on a black background</li>
 <li>Subsequent forward or backward searches will navigate to the next match</li>
-<li>To <b>clear the search highlighting</b>, clear the text field and press
<b>F3</b>)</li>
+<li>To <b>clear the find highlighting</b>, clear the text field and press
<b>F3</b> or <b>enter</b></li>
 </ul>
 <p>
 <A NAME="display_filter"><h3>Display filters (refine focus)</h3>



Mime
View raw message