logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpo...@apache.org
Subject svn commit: r1480272 - in /logging/log4j/log4j2/trunk/jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui: ClientGUI.java package-info.java
Date Wed, 08 May 2013 13:44:24 GMT
Author: rpopma
Date: Wed May  8 13:44:24 2013
New Revision: 1480272

URL: http://svn.apache.org/r1480272
Log:
Add missing package-info file, added ability to toggle line-wrap in status console

Added:
    logging/log4j/log4j2/trunk/jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/package-info.java
  (with props)
Modified:
    logging/log4j/log4j2/trunk/jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java

Modified: logging/log4j/log4j2/trunk/jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java?rev=1480272&r1=1480271&r2=1480272&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java
(original)
+++ logging/log4j/log4j2/trunk/jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/ClientGUI.java
Wed May  8 13:44:24 2013
@@ -19,6 +19,7 @@ package org.apache.logging.log4j.jmx.gui
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Font;
+import java.awt.event.ActionEvent;
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
@@ -34,12 +35,14 @@ import javax.management.ObjectName;
 import javax.management.remote.JMXConnector;
 import javax.management.remote.JMXConnectorFactory;
 import javax.management.remote.JMXServiceURL;
+import javax.swing.AbstractAction;
 import javax.swing.JFrame;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JTabbedPane;
 import javax.swing.JTextArea;
+import javax.swing.JToggleButton;
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
 import javax.swing.UIManager.LookAndFeelInfo;
@@ -61,6 +64,17 @@ public class ClientGUI extends JPanel im
     private Client client;
     private JTextArea statusLogTextArea;
     private JTabbedPane tabbedPane;
+    private JToggleButton wrapLinesToggleButton;
+
+    private AbstractAction toggleWrapAction = new AbstractAction() {
+        private static final long serialVersionUID = -4214143754637722322L;
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            boolean wrap = wrapLinesToggleButton.isSelected();
+            statusLogTextArea.setLineWrap(wrap);
+        }
+    };
 
     public ClientGUI(Client client) throws InstanceNotFoundException,
             MalformedObjectNameException, IOException {
@@ -77,7 +91,14 @@ public class ClientGUI extends JPanel im
         statusLogTextArea.setForeground(Color.black);
         statusLogTextArea.setFont(new Font("Monospaced", Font.PLAIN,
                 statusLogTextArea.getFont().getSize()));
-        JScrollPane scrollStatusLog = new JScrollPane(statusLogTextArea);
+        statusLogTextArea.setWrapStyleWord(true);
+
+        wrapLinesToggleButton = new JToggleButton(toggleWrapAction);
+        wrapLinesToggleButton.setToolTipText("Toggle line wrapping");
+        JScrollPane scrollStatusLog = new JScrollPane(statusLogTextArea, //
+                JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, //
+                JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+        scrollStatusLog.setCorner(JScrollPane.LOWER_RIGHT_CORNER, wrapLinesToggleButton);
 
         tabbedPane = new JTabbedPane();
         tabbedPane.addTab("StatusLogger", scrollStatusLog);

Added: logging/log4j/log4j2/trunk/jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/package-info.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/package-info.java?rev=1480272&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/package-info.java
(added)
+++ logging/log4j/log4j2/trunk/jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/package-info.java
Wed May  8 13:44:24 2013
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache license, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the license for the specific language governing permissions and
+ * limitations under the license.
+ */
+/**
+ * Log4j 2.0 JMX GUI.
+ */
+package org.apache.logging.log4j.jmx.gui;

Propchange: logging/log4j/log4j2/trunk/jmx-gui/src/main/java/org/apache/logging/log4j/jmx/gui/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message