From general-return-1375-apmail-logging-general-archive=logging.apache.org@logging.apache.org Wed Mar 24 06:42:12 2010 Return-Path: Delivered-To: apmail-logging-general-archive@www.apache.org Received: (qmail 61017 invoked from network); 24 Mar 2010 06:42:12 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 24 Mar 2010 06:42:12 -0000 Received: (qmail 52540 invoked by uid 500); 24 Mar 2010 06:42:12 -0000 Delivered-To: apmail-logging-general-archive@logging.apache.org Received: (qmail 52387 invoked by uid 500); 24 Mar 2010 06:42:11 -0000 Mailing-List: contact general-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Logging General" List-Id: Delivered-To: mailing list general@logging.apache.org Received: (qmail 52379 invoked by uid 99); 24 Mar 2010 06:42:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Mar 2010 06:42:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Mar 2010 06:42:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E97DB23889B3; Wed, 24 Mar 2010 06:41:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r926952 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/LogPanel.java resources/org/apache/log4j/chainsaw/help/release-notes.html Date: Wed, 24 Mar 2010 06:41:46 -0000 To: general@logging.apache.org From: sdeboy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100324064146.E97DB23889B3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sdeboy Date: Wed Mar 24 06:41:46 2010 New Revision: 926952 URL: http://svn.apache.org/viewvc?rev=926952&view=rev Log: New feature: search/refine focus from a selection in the details panel - Details panel entry no longer refreshes even when selection hasn't changed (the contents of the detail pane were being updated, preventing text selection) - Event details context menu (right click) now has 'set refine focus' and 'find next' menu items that will update the refine focus/find next fields with the selected text (building a 'msg ~= SELECTEDTEXT' expression) Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java 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/LogPanel.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java?rev=926952&r1=926951&r2=926952&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 Wed Mar 24 06:41:46 2010 @@ -858,7 +858,7 @@ public class LogPanel extends DockablePa detailArea.setText(buf.toString()); } else { - detailArea.setText((o == null) ? "" : o.toString()); + detailArea.setText(o.toString()); } detailDialog.setLocation(lowerPanel.getLocationOnScreen()); @@ -1039,6 +1039,7 @@ public class LogPanel extends DockablePa detailPaneUpdater = new DetailPaneUpdater(); + //if the panel gets focus, update the detail pane addFocusListener(new FocusListener() { public void focusGained(FocusEvent e) { @@ -1123,6 +1124,29 @@ public class LogPanel extends DockablePa } }); + Action copyToRefineFocusAction = new AbstractAction("Set 'refine focus' field") { + public void actionPerformed(ActionEvent e) { + String selectedText = detail.getSelectedText(); + if (selectedText == null || selectedText.equals("")) { + //no-op empty searches + return; + } + filterText.setText("msg ~= '" + selectedText + "'"); + } + }; + + Action copyToSearchAction = new AbstractAction("Find next") { + public void actionPerformed(ActionEvent e) { + String selectedText = detail.getSelectedText(); + if (selectedText == null || selectedText.equals("")) { + //no-op empty searches + return; + } + findField.setText("msg ~= '" + selectedText + "'"); + findNext(); + } + }; + Action editDetailAction = new AbstractAction( "Edit...", new ImageIcon(ChainsawIcons.ICON_EDIT_RECEIVER)) { @@ -1170,6 +1194,11 @@ public class LogPanel extends DockablePa detailPanel.add(detailToolbar, BorderLayout.NORTH); JPopupMenu editDetailPopupMenu = new JPopupMenu(); + + editDetailPopupMenu.add(copyToRefineFocusAction); + editDetailPopupMenu.add(copyToSearchAction); + editDetailPopupMenu.addSeparator(); + editDetailPopupMenu.add(editDetailAction); editDetailPopupMenu.addSeparator(); @@ -2854,7 +2883,7 @@ public class LogPanel extends DockablePa */ private class DetailPaneUpdater implements PropertyChangeListener { private int selectedRow = -1; - + int lastRow = -1; private DetailPaneUpdater() { } @@ -2882,7 +2911,7 @@ public class LogPanel extends DockablePa } LoggingEvent event = null; - if (selectedRow != -1) { + if (selectedRow != -1 && (lastRow != selectedRow)) { event = tableModel.getRow(selectedRow); if (event != null) { @@ -2898,6 +2927,7 @@ public class LogPanel extends DockablePa public void run() { detail.setDocument(doc); detail.setCaretPosition(0); + lastRow = selectedRow; } }); } catch (Exception e) {} @@ -2905,7 +2935,7 @@ public class LogPanel extends DockablePa } } - if (event == null) { + if (event == null && (lastRow != selectedRow)) { try { final Document doc = detail.getEditorKit().createDefaultDocument(); detail.getEditorKit().read(new StringReader("Nothing selected"), doc, 0); @@ -2913,6 +2943,7 @@ public class LogPanel extends DockablePa public void run() { detail.setDocument(doc); detail.setCaretPosition(0); + lastRow = selectedRow; } }); } catch (Exception e) {} 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=926952&r1=926951&r2=926952&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 Wed Mar 24 06:41:46 2010 @@ -15,6 +15,12 @@
  • 'Refine focus' field now supports auto-filtering: entering text in the refine focus field now causes the popup to display matching entries (reminder: you can press enter to add entries to this box, and those entries are persisted)
  • +
  • +Event details context menu (right click) now has 'set refine focus' and 'find next' menu items that will update the refine focus/find next fields with the selected text (building a 'msg ~= SELECTEDTEXT' expression) +
  • +
  • +Details panel entry no longer refreshes even when selection hasn't changed (the contents of the detail pane were being updated, preventing text selection) +
  • 20 Mar 2010