jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1526400 - in /jmeter/trunk: bin/jmeter.properties src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java
Date Thu, 26 Sep 2013 06:46:37 GMT
Author: pmouawad
Date: Thu Sep 26 06:46:36 2013
New Revision: 1526400

URL: http://svn.apache.org/r1526400
Log:
Bug 55202 - Add syntax color for scripts elements (BeanShell, BSF, and JSR223) and JDBC elements
with RSyntaxTextArea
Add a way to disable undo feature in JSyntaxtTextArea, thanks Robert Futrell
Bugzilla Id: 55202

Modified:
    jmeter/trunk/bin/jmeter.properties
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java

Modified: jmeter/trunk/bin/jmeter.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/jmeter.properties?rev=1526400&r1=1526399&r2=1526400&view=diff
==============================================================================
--- jmeter/trunk/bin/jmeter.properties (original)
+++ jmeter/trunk/bin/jmeter.properties Thu Sep 26 06:46:36 2013
@@ -915,6 +915,8 @@ beanshell.server.file=../extras/startup.
 #jsyntaxtextarea.wrapstyleword=true
 #jsyntaxtextarea.linewrap=true
 #jsyntaxtextarea.codefolding=true
+# Set 0 to disable undo feature in JSyntaxTextArea
+#jsyntaxtextarea.maxundos=50
 
 # Maximum size of HTML page that can be displayed; default=200 * 1024
 # Set to 0 to disable the size check

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java?rev=1526400&r1=1526399&r2=1526400&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxTextArea.java Thu Sep 26 06:46:36
2013
@@ -21,9 +21,9 @@ package org.apache.jmeter.gui.util;
 import java.util.Properties;
 
 import org.apache.jmeter.util.JMeterUtils;
-
 import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
 import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
+import org.fife.ui.rtextarea.RUndoManager;
 
 /**
  * Utility class to handle RSyntaxTextArea code
@@ -37,6 +37,7 @@ public class JSyntaxTextArea extends RSy
     private final boolean WRAP_STYLE_WORD = JMeterUtils.getPropDefault("jsyntaxtextarea.wrapstyleword",
true);
     private final boolean LINE_WRAP       = JMeterUtils.getPropDefault("jsyntaxtextarea.linewrap",
true);
     private final boolean CODE_FOLDING    = JMeterUtils.getPropDefault("jsyntaxtextarea.codefolding",
true);
+    private final int MAX_UNDOS           = JMeterUtils.getPropDefault("jsyntaxtextarea.maxundos",
50);
 
     @Deprecated
     public JSyntaxTextArea() {
@@ -78,4 +79,15 @@ public class JSyntaxTextArea extends RSy
         }
     }
 
+    /**
+     * Override UndoManager to allow disabling if feature causes issues
+     * See https://github.com/bobbylight/RSyntaxTextArea/issues/19
+     */
+    @Override
+    protected RUndoManager createUndoManager() {
+        RUndoManager undoManager = super.createUndoManager();
+        undoManager.setLimit(MAX_UNDOS);
+        return undoManager;
+    }
+
 }



Mime
View raw message