jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1848039 - /jmeter/trunk/src/core/org/apache/jmeter/gui/action/SelectTemplatesDialog.java
Date Mon, 03 Dec 2018 13:23:29 GMT
Author: pmouawad
Date: Mon Dec  3 13:23:29 2018
New Revision: 1848039

URL: http://svn.apache.org/viewvc?rev=1848039&view=rev
Log:
Bug 62870 - Templates : Add ability to provide parameters 

Avoid resetting templates when not necessary


Bugzilla Id: 62870

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/SelectTemplatesDialog.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/SelectTemplatesDialog.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/SelectTemplatesDialog.java?rev=1848039&r1=1848038&r2=1848039&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/action/SelectTemplatesDialog.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/action/SelectTemplatesDialog.java Mon Dec
 3 13:23:29 2018
@@ -160,7 +160,7 @@ public class SelectTemplatesDialog exten
         if (template == null) {
             return;
         }
-        templateList.setValues(TemplateManager.getInstance().reset().getTemplateNames());
// reload the templates before loading
+        templateList.setValues(TemplateManager.getInstance().getTemplateNames()); // reload
the templates before loading
         
         final boolean isTestPlan = template.isTestPlan();
         // Check if the user wants to drop any changes
@@ -259,7 +259,7 @@ public class SelectTemplatesDialog exten
         this.addWindowListener(new WindowAdapter(){
             @Override
             public void windowClosing(WindowEvent evt){
-                resetJDialog();
+                resetJDialog(false);
                 dispose();
             }
         });
@@ -301,7 +301,7 @@ public class SelectTemplatesDialog exten
     public void actionPerformed(ActionEvent e) {
         final Object source = e.getSource();
         if (source == cancelButton) {
-            resetJDialog();
+            resetJDialog(false);
             this.dispose();
         } else if (source == applyTemplateButton) {
             String selectedTemplate = templateList.getText();
@@ -312,11 +312,13 @@ public class SelectTemplatesDialog exten
             } else {
                 checkDirtyAndLoad(e);
             }
-        } else if (source == reloadTemplateButton || source == previous) {
-            resetJDialog();
+        } else if (source == reloadTemplateButton) {
+            resetJDialog(true);
+        } else if (source == previous) { 
+            resetJDialog(false);
         } else if (source == validateButton) {
             checkDirtyAndLoad(e);
-            resetJDialog();
+            resetJDialog(false);
         }
     }
     
@@ -334,8 +336,11 @@ public class SelectTemplatesDialog exten
         populateTemplatePage();
     }
     
-    private void resetJDialog() {
-        templateList.setValues(TemplateManager.getInstance().reset().getTemplateNames());
// reload templates
+    private void resetJDialog(boolean reloadTemplates) {
+        if(reloadTemplates) {
+            TemplateManager.getInstance().reset();
+        }
+        templateList.setValues(TemplateManager.getInstance().getTemplateNames()); // reload
templates
         this.setContentPane(templateSelectionPanel());
         this.revalidate();
     }



Mime
View raw message