Return-Path: Delivered-To: apmail-logging-general-archive@www.apache.org Received: (qmail 92061 invoked from network); 12 Sep 2010 05:29:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Sep 2010 05:29:48 -0000 Received: (qmail 30563 invoked by uid 500); 12 Sep 2010 05:29:48 -0000 Delivered-To: apmail-logging-general-archive@logging.apache.org Received: (qmail 30418 invoked by uid 500); 12 Sep 2010 05:29:46 -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 30407 invoked by uid 99); 12 Sep 2010 05:29:45 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Sep 2010 05:29:45 +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; Sun, 12 Sep 2010 05:29:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2878623889B3; Sun, 12 Sep 2010 05:29:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r996254 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ReceiverConfigurationPanel.java Date: Sun, 12 Sep 2010 05:29:06 -0000 To: general@logging.apache.org From: sdeboy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100912052906.2878623889B3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sdeboy Date: Sun Sep 12 05:29:05 2010 New Revision: 996254 URL: http://svn.apache.org/viewvc?rev=996254&view=rev Log: Minor update to receiver configuration panel - changed logformat to a combobox and pre-loaded combobox with a few examples Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ReceiverConfigurationPanel.java Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ReceiverConfigurationPanel.java URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ReceiverConfigurationPanel.java?rev=996254&r1=996253&r2=996254&view=diff ============================================================================== --- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ReceiverConfigurationPanel.java (original) +++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ReceiverConfigurationPanel.java Sun Sep 12 05:29:05 2010 @@ -77,9 +77,10 @@ class ReceiverConfigurationPanel extends private JButton browseLogFileButton; private JComboBox logFileFormatTypeComboBox; - private JTextField logFileFormatTextField; + private JComboBox logFileFormatComboBox; private JComboBox logFileFormatTimestampFormatComboBox; private JTextField logFileURLTextField; + private DefaultComboBoxModel logFileFormatComboBoxModel; private DefaultComboBoxModel logFileFormatTimestampFormatComboBoxModel; //use existing configuration widgets @@ -118,9 +119,9 @@ class ReceiverConfigurationPanel extends buttonGroup = new ButtonGroup(); lowerPanel = new JPanel(new BorderLayout()); - lowerPanel.setBorder(BorderFactory.createEtchedBorder()); - lowerPanel.setPreferredSize(new Dimension(600, 275)); - lowerPanel.setMinimumSize(new Dimension(600, 275)); + lowerPanel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(), BorderFactory.createEmptyBorder(5, 5, 5, 5))); + lowerPanel.setPreferredSize(new Dimension(600, 200)); + lowerPanel.setMinimumSize(new Dimension(600, 200)); int yPos = 0; @@ -377,8 +378,11 @@ class ReceiverConfigurationPanel extends c.insets = new Insets(0, 5, 5, 5); panel.add(new JLabel(" Log file format "), c); - logFileFormatTextField = new JTextField(); - logFileFormatTextField.setEditable(true); + logFileFormatComboBoxModel = new DefaultComboBoxModel(); + seedLogFileFormatComboBoxModel(); + logFileFormatComboBox = new JComboBox(logFileFormatComboBoxModel); + logFileFormatComboBox.setEditable(true); + logFileFormatComboBox.setOpaque(false); c = new GridBagConstraints(); c.gridx = 1; @@ -387,7 +391,7 @@ class ReceiverConfigurationPanel extends c.anchor = GridBagConstraints.LINE_START; c.fill = GridBagConstraints.HORIZONTAL; c.insets = new Insets(0, 0, 5, 0); - panel.add(logFileFormatTextField, c); + panel.add(logFileFormatComboBox, c); c = new GridBagConstraints(); c.gridx = 0; @@ -414,10 +418,18 @@ class ReceiverConfigurationPanel extends c.gridy = 5; c.gridwidth=5; c.insets = new Insets(5, 5, 0, 5); - panel.add(new JLabel(" Log file format examples:
  • PatternLayout: %-5p %d [%t] %c: %m%n
  • LogFilePatternReceiver: LEVEL TIMESTAMP [THREAD] LOGGER: MESSAGE
See PatternLayout or LogFilePatternReceiver JavaDoc for details"), c); + panel.add(new JLabel(" See PatternLayout or LogFilePatternReceiver JavaDoc for details "), c); return panel; } + private void seedLogFileFormatComboBoxModel() + { + logFileFormatComboBoxModel.addElement("%p %t %c - %m%n"); + logFileFormatComboBoxModel.addElement("LEVEL THREAD LOGGER - MESSAGE"); + logFileFormatComboBoxModel.addElement("%d{ABSOLUTE} %-5p [%c{1}] %m%n"); + logFileFormatComboBoxModel.addElement("TIMESTAMP LEVEL [LOGGER] MESSAGE"); + } + private void seedLogFileFormatTimestampComboBoxModel() { logFileFormatTimestampFormatComboBoxModel.addElement("yyyy-MM-dd HH:mm:ss,SSS"); @@ -712,7 +724,7 @@ class ReceiverConfigurationPanel extends } String getLogFormat() { - Object item = logFileFormatTextField.getText(); + Object item = logFileFormatComboBox.getSelectedItem(); if (item != null) { return item.toString(); }