jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1627121 - in /jmeter/trunk: src/core/org/apache/jmeter/gui/GuiPackage.java src/core/org/apache/jmeter/gui/UndoHistory.java xdocs/changes.xml
Date Tue, 23 Sep 2014 19:14:32 GMT
Author: pmouawad
Date: Tue Sep 23 19:14:31 2014
New Revision: 1627121

URL: http://svn.apache.org/r1627121
Log:
Bug 42248 - Undo-redo support on Test Plan tree modification. 
Bugzilla Id: 42248

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/UndoHistory.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java?rev=1627121&r1=1627120&r2=1627121&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/GuiPackage.java Tue Sep 23 19:14:31 2014
@@ -137,7 +137,9 @@ public final class GuiPackage implements
      */
     private GuiPackage(JMeterTreeModel treeModel, JMeterTreeListener treeListener) {
         this.treeModel = treeModel;
-        this.treeModel.addTreeModelListener(undoHistory);
+        if(undoHistory.isEnabled()) {
+            this.treeModel.addTreeModelListener(undoHistory);
+        }
         this.treeListener = treeListener;
     }
 
@@ -156,7 +158,9 @@ public final class GuiPackage implements
      * - Locale Changes
      */
     public void registerAsListener() {
-        this.undoHistory.registerHistoryListener(this);
+        if(undoHistory.isEnabled()) {
+            this.undoHistory.registerHistoryListener(this);
+        }
         JMeterUtils.addLocaleChangeListener(this);
     }
 

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/UndoHistory.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/UndoHistory.java?rev=1627121&r1=1627120&r2=1627121&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/UndoHistory.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/UndoHistory.java Tue Sep 23 19:14:31 2014
@@ -133,6 +133,11 @@ public class UndoHistory implements Tree
      * @param comment   String
      */
     public void add(JMeterTreeModel treeModel, String comment) {
+        if(!isEnabled()) {
+            log.debug("undo.history.size is set to 0, undo/redo feature is disabled");
+            return;
+        }
+
         // don't add element if we are in the middle of undo/redo or a big loading
         if (working) {
             log.debug("Not adding history because of noop");
@@ -338,6 +343,14 @@ public class UndoHistory implements Tree
     }
     
     /**
+     * 
+     * @return true if history is enabled
+     */
+    boolean isEnabled() {
+        return HISTORY_SIZE > 0;
+    }
+    
+    /**
      * Register HistoryListener 
      * @param listener
      */

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1627121&r1=1627120&r2=1627121&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Tue Sep 23 19:14:31 2014
@@ -296,7 +296,7 @@ for details on configuring this componen
 <li><bugzilla>56455</bugzilla> - Batch files: drop support for non-NT Windows
shell scripts</li>
 <li><bugzilla>56807</bugzilla> - Ability to force flush of ResultCollector
file. Contributed by Andrey Pohilko (apc4 at ya.ru)</li>
 <li><bugzilla>56921</bugzilla> - Templates : Improve Recording template
to ignore embedded resources case and URL parameters. Contributed by Ubik Load Pack (support
at ubikloadpack.com)</li>
-<li><bugzilla>42248</bugzilla> - Undo-redo support on Test Plan tree modification.
Developed by Andrey Pohilko (apc4 at ya.ru) and contributed by BlazeMeter Ltd.</li></ul>
+<li><bugzilla>42248</bugzilla> - Undo-redo support on Test Plan tree modification.
Developed by Andrey Pohilko (apc4 at ya.ru) and contributed by BlazeMeter Ltd. Additional
contribution by Ubik Load Pack (support at ubikloadpack.com)</li></ul>
 <li><bugzilla>56920</bugzilla> - LogViewer : Make it receive all log events
even when it is closed. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
 
 <ch_section>Non-functional changes</ch_section>



Mime
View raw message