jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1655884 - in /jmeter/trunk: bin/jmeter.properties src/core/org/apache/jmeter/gui/LoggerPanel.java xdocs/changes.xml
Date Thu, 29 Jan 2015 23:30:57 GMT
Author: sebb
Date: Thu Jan 29 23:30:56 2015
New Revision: 1655884

URL: http://svn.apache.org/r1655884
Log:
Added property loggerpanel.usejsyntaxtext to disable the use of JSyntaxTextArea for the Console
Logger (in case of memory or other issues)

Modified:
    jmeter/trunk/bin/jmeter.properties
    jmeter/trunk/src/core/org/apache/jmeter/gui/LoggerPanel.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/bin/jmeter.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/jmeter.properties?rev=1655884&r1=1655883&r2=1655884&view=diff
==============================================================================
--- jmeter/trunk/bin/jmeter.properties (original)
+++ jmeter/trunk/bin/jmeter.properties Thu Jan 29 23:30:56 2015
@@ -1017,6 +1017,9 @@ beanshell.server.file=../extras/startup.
 # Set 0 to disable undo feature in JSyntaxTextArea
 #jsyntaxtextarea.maxundos=50
 
+# Set this to false to disable the use of JSyntaxTextArea for the Console Logger panel 
+#loggerpanel.usejsyntaxtext=true
+
 # Maximum size of HTML page that can be displayed; default=200 * 1024
 # Set to 0 to disable the size check and display the whole response
 #view.results.tree.max_size=204800

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/LoggerPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/LoggerPanel.java?rev=1655884&r1=1655883&r2=1655884&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/LoggerPanel.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/LoggerPanel.java Thu Jan 29 23:30:56 2015
@@ -23,6 +23,7 @@ import java.awt.Insets;
 
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
 import javax.swing.ScrollPaneConstants;
 import javax.swing.SwingUtilities;
 
@@ -42,7 +43,7 @@ public class LoggerPanel extends JPanel
 
     private static final long serialVersionUID = 6911128494402594429L;
 
-    private JSyntaxTextArea textArea;
+    private final JTextArea textArea;
 
     private final PatternFormatter format;
 
@@ -50,8 +51,6 @@ public class LoggerPanel extends JPanel
     private static final int LOGGER_PANEL_MAX_LENGTH =
             JMeterUtils.getPropDefault("jmeter.loggerpanel.maxlength", 80000); // $NON-NLS-1$
     
-    private static final int LOGGER_PANEL_MAX_LINES_COUNT = LOGGER_PANEL_MAX_LENGTH / 80;
// $NON-NLS-1$
-    
     // Make panel handle event even if closed
     private static final boolean LOGGER_PANEL_RECEIVE_WHEN_CLOSED =
             JMeterUtils.getPropDefault("jmeter.loggerpanel.enable_when_closed", true); //
$NON-NLS-1$
@@ -60,27 +59,37 @@ public class LoggerPanel extends JPanel
      * Pane for display JMeter log file
      */
     public LoggerPanel() {
-        init();
+        textArea = init();
         format = new PatternFormatter(LoggingManager.DEFAULT_PATTERN + "\n"); // $NON-NLS-1$
     }
 
-    private void init() {
+    private JTextArea init() {
         this.setLayout(new BorderLayout());
+        final JScrollPane areaScrollPane;
+        final JTextArea jTextArea;
 
-        // TEXTAREA
-        textArea = new JSyntaxTextArea(15, 80, true);
-        textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
-        textArea.setCodeFoldingEnabled(false);
-        textArea.setAntiAliasingEnabled(false);
-        textArea.setEditable(false);
-        textArea.setLineWrap(false);
-        textArea.setLanguage("text");
-        textArea.setMargin(new Insets(2, 2, 2, 2)); // space between borders and text
-        JScrollPane areaScrollPane = new JTextScrollPane(textArea);
+        if (JMeterUtils.getPropDefault("loggerpanel.usejsyntaxtext", true)) {
+            // JSyntax Text Area
+            JSyntaxTextArea jSyntaxTextArea = new JSyntaxTextArea(15, 80, true);
+            jSyntaxTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
+            jSyntaxTextArea.setCodeFoldingEnabled(false);
+            jSyntaxTextArea.setAntiAliasingEnabled(false);
+            jSyntaxTextArea.setEditable(false);
+            jSyntaxTextArea.setLineWrap(false);
+            jSyntaxTextArea.setLanguage("text");
+            jSyntaxTextArea.setMargin(new Insets(2, 2, 2, 2)); // space between borders and
text
+            areaScrollPane = new JTextScrollPane(jSyntaxTextArea);
+            jTextArea = jSyntaxTextArea;
+        } else {
+            // Plain text area
+            jTextArea =  new JTextArea(15, 80);
+            areaScrollPane = new JScrollPane(jTextArea);
+        }
 
         areaScrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
         areaScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
-        this.add(areaScrollPane, BorderLayout.CENTER); 
+        this.add(areaScrollPane, BorderLayout.CENTER);
+        return jTextArea;
     }
 
     /* (non-Javadoc)

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1655884&r1=1655883&r2=1655884&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Thu Jan 29 23:30:56 2015
@@ -234,6 +234,7 @@ See  <bugzilla>56357</bugzilla> for deta
 <li><bug>57418</bug>Remove unused constructor from Workbench</li>
 <li><bug>57419</bug>Remove unused interface ModelListener.</li>
 <li><bug>57466</bug>IncludeController : Remove an unneeded set creation.
Contributed by Benoit Wiart (benoit.wiart at gmail.com)</li>
+<li>Added property loggerpanel.usejsyntaxtext to disable the use of JSyntaxTextArea
for the Console Logger (in case of memory or other issues)</li>
 </ul>
 
 <ch_section>Thanks</ch_section>



Mime
View raw message