jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1302215 - in /jmeter/trunk: bin/ src/components/org/apache/jmeter/timers/gui/ src/core/org/apache/jmeter/ src/core/org/apache/jmeter/control/gui/ src/core/org/apache/jmeter/gui/action/ src/core/org/apache/jmeter/threads/gui/ xdocs/
Date Sun, 18 Mar 2012 20:13:43 GMT
Author: pmouawad
Date: Sun Mar 18 20:13:42 2012
New Revision: 1302215

URL: http://svn.apache.org/viewvc?rev=1302215&view=rev
Log:
Bug 52934 - GUI : Open Test plan with the tree expanded to the testplan level and no further
and select the root of the tree

Modified:
    jmeter/trunk/bin/jmeter.properties
    jmeter/trunk/src/components/org/apache/jmeter/timers/gui/AbstractRandomTimerGui.java
    jmeter/trunk/src/core/org/apache/jmeter/JMeter.java
    jmeter/trunk/src/core/org/apache/jmeter/control/gui/IfControllerPanel.java
    jmeter/trunk/src/core/org/apache/jmeter/control/gui/WhileControllerGui.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/Close.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/Load.java
    jmeter/trunk/src/core/org/apache/jmeter/threads/gui/ThreadGroupGui.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/bin/jmeter.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/jmeter.properties?rev=1302215&r1=1302214&r2=1302215&view=diff
==============================================================================
--- jmeter/trunk/bin/jmeter.properties (original)
+++ jmeter/trunk/bin/jmeter.properties Sun Mar 18 20:13:42 2012
@@ -832,7 +832,8 @@ beanshell.server.file=../extras/startup.
 #jmeterthread.rampup.granularity=1000
 
 #Should JMeter expand the tree when loading a test plan?
-#onload.expandtree=true
+# default value is false since JMeter 2.7
+#onload.expandtree=false
 
 # Maximum size of HTML page that can be displayed; default=200 * 1024
 # Set to 0 to disable the size check

Modified: jmeter/trunk/src/components/org/apache/jmeter/timers/gui/AbstractRandomTimerGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/timers/gui/AbstractRandomTimerGui.java?rev=1302215&r1=1302214&r2=1302215&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/timers/gui/AbstractRandomTimerGui.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/timers/gui/AbstractRandomTimerGui.java Sun
Mar 18 20:13:42 2012
@@ -28,7 +28,6 @@ import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JTextField;
 
-import org.apache.jmeter.gui.util.FocusRequester;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.timers.ConstantTimer;
 import org.apache.jmeter.timers.RandomTimer;
@@ -148,9 +147,6 @@ public abstract class AbstractRandomTime
         threadDelayPropsPanel.setMaximumSize(new Dimension(threadDelayPropsPanel.getMaximumSize().width,
                 threadDelayPropsPanel.getPreferredSize().height));
         add(threadDelayPropsPanel);
-
-        // Set the initial focus to the delay field
-        new FocusRequester(rangeField);
     }
     
     /**

Modified: jmeter/trunk/src/core/org/apache/jmeter/JMeter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/JMeter.java?rev=1302215&r1=1302214&r2=1302215&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/JMeter.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/JMeter.java Sun Mar 18 20:13:42 2012
@@ -42,6 +42,9 @@ import java.util.Properties;
 import java.util.StringTokenizer;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import javax.swing.JTree;
+import javax.swing.tree.TreePath;
+
 import org.apache.commons.cli.avalon.CLArgsParser;
 import org.apache.commons.cli.avalon.CLOption;
 import org.apache.commons.cli.avalon.CLOptionDescriptor;
@@ -62,6 +65,7 @@ import org.apache.jmeter.gui.action.Load
 import org.apache.jmeter.gui.tree.JMeterTreeListener;
 import org.apache.jmeter.gui.tree.JMeterTreeModel;
 import org.apache.jmeter.gui.tree.JMeterTreeNode;
+import org.apache.jmeter.gui.util.FocusRequester;
 import org.apache.jmeter.plugin.JMeterPlugin;
 import org.apache.jmeter.plugin.PluginManager;
 import org.apache.jmeter.reporters.ResultCollector;
@@ -250,6 +254,11 @@ public class JMeter implements JMeterPlu
             } finally {
                 JOrphanUtils.closeQuietly(reader);
             }
+        } else {
+            JTree jTree = GuiPackage.getInstance().getMainFrame().getTree();
+            TreePath path = jTree.getPathForRow(0);
+            jTree.setSelectionPath(path);
+            new FocusRequester(jTree);
         }
     }
 

Modified: jmeter/trunk/src/core/org/apache/jmeter/control/gui/IfControllerPanel.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/control/gui/IfControllerPanel.java?rev=1302215&r1=1302214&r2=1302215&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/control/gui/IfControllerPanel.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/control/gui/IfControllerPanel.java Sun Mar 18
20:13:42 2012
@@ -40,7 +40,7 @@ import org.apache.jmeter.util.JMeterUtil
  *
  */
 
-public class IfControllerPanel extends AbstractControllerGui implements ActionListener {
+public class IfControllerPanel extends AbstractControllerGui {
 
     private static final long serialVersionUID = 240L;
 
@@ -136,17 +136,6 @@ public class IfControllerPanel extends A
         evaluateAll.setSelected(false);
     }
 
-    /**
-     * Invoked when an action occurs. This implementation assumes that the
-     * target component is the infinite loops checkbox.
-     *
-     * @param event
-     *            the event that has occurred
-     */
-    public void actionPerformed(ActionEvent event) {
-        new FocusRequester(theCondition);
-    }
-
     public String getLabelResource() {
         return "if_controller_title"; // $NON-NLS-1$
     }
@@ -188,8 +177,7 @@ public class IfControllerPanel extends A
         theCondition = new JTextField(""); // $NON-NLS-1$
         conditionLabel.setLabelFor(theCondition);
         conditionPanel.add(theCondition, BorderLayout.CENTER);
-        theCondition.addActionListener(this);
-
+       
         conditionPanel.add(Box.createHorizontalStrut(conditionLabel.getPreferredSize().width
                 + theCondition.getPreferredSize().width), BorderLayout.NORTH);
 

Modified: jmeter/trunk/src/core/org/apache/jmeter/control/gui/WhileControllerGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/control/gui/WhileControllerGui.java?rev=1302215&r1=1302214&r2=1302215&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/control/gui/WhileControllerGui.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/control/gui/WhileControllerGui.java Sun Mar 18
20:13:42 2012
@@ -19,8 +19,6 @@
 package org.apache.jmeter.control.gui;
 
 import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 
 import javax.swing.Box;
 import javax.swing.JLabel;
@@ -28,11 +26,10 @@ import javax.swing.JPanel;
 import javax.swing.JTextField;
 
 import org.apache.jmeter.control.WhileController;
-import org.apache.jmeter.gui.util.FocusRequester;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.util.JMeterUtils;
 
-public class WhileControllerGui extends AbstractControllerGui implements ActionListener {
+public class WhileControllerGui extends AbstractControllerGui {
 
     private static final long serialVersionUID = 240L;
 
@@ -103,17 +100,6 @@ public class WhileControllerGui extends 
         theCondition.setText(""); // $NON-NLS-1$
     }
 
-    /**
-     * Invoked when an action occurs. This implementation assumes that the
-     * target component is the infinite loops checkbox.
-     *
-     * @param event
-     *            the event that has occurred
-     */
-    public void actionPerformed(ActionEvent event) {
-        new FocusRequester(theCondition);
-    }
-
     public String getLabelResource() {
         return "while_controller_title"; // $NON-NLS-1$
     }
@@ -150,8 +136,7 @@ public class WhileControllerGui extends 
         theCondition.setName(CONDITION);
         conditionLabel.setLabelFor(theCondition);
         conditionPanel.add(theCondition, BorderLayout.CENTER);
-        theCondition.addActionListener(this);
-
+        
         conditionPanel.add(Box.createHorizontalStrut(conditionLabel.getPreferredSize().width
                 + theCondition.getPreferredSize().width), BorderLayout.NORTH);
 

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/Close.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/Close.java?rev=1302215&r1=1302214&r2=1302215&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/action/Close.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/action/Close.java Sun Mar 18 20:13:42 2012
@@ -23,8 +23,10 @@ import java.util.HashSet;
 import java.util.Set;
 
 import javax.swing.JOptionPane;
+import javax.swing.JTree;
 
 import org.apache.jmeter.gui.GuiPackage;
+import org.apache.jmeter.gui.util.FocusRequester;
 import org.apache.jmeter.util.JMeterUtils;
 
 /**
@@ -96,8 +98,9 @@ public class Close implements Command {
         GuiPackage guiPackage = GuiPackage.getInstance();
 
         guiPackage.clearTestPlan();
-        guiPackage.getTreeListener().getJTree().setSelectionRow(1);
-
+        JTree tree = guiPackage.getTreeListener().getJTree();
+        tree.setSelectionRow(0);
+        new FocusRequester(tree);
         ActionRouter.getInstance().actionPerformed(new ActionEvent(e.getSource(), e.getID(),
ActionNames.ADD_ALL));
     }
 }

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/Load.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/Load.java?rev=1302215&r1=1302214&r2=1302215&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/action/Load.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/action/Load.java Sun Mar 18 20:13:42 2012
@@ -34,6 +34,7 @@ import org.apache.jmeter.exceptions.Ille
 import org.apache.jmeter.gui.GuiPackage;
 import org.apache.jmeter.gui.tree.JMeterTreeNode;
 import org.apache.jmeter.gui.util.FileDialoger;
+import org.apache.jmeter.gui.util.FocusRequester;
 import org.apache.jmeter.gui.util.MenuFactory;
 import org.apache.jmeter.save.SaveService;
 import org.apache.jmeter.services.FileServer;
@@ -55,7 +56,7 @@ import com.thoughtworks.xstream.converte
 public class Load implements Command {
     private static final Logger log = LoggingManager.getLoggerForClass();
 
-    private static final boolean expandTree = JMeterUtils.getPropDefault("onload.expandtree",
true); //$NON-NLS-1$
+    private static final boolean expandTree = JMeterUtils.getPropDefault("onload.expandtree",
false); //$NON-NLS-1$
 
     private static final Set<String> commands = new HashSet<String>();
 
@@ -190,13 +191,17 @@ public class Load implements Command {
         }
 
         ActionRouter.getInstance().actionPerformed(actionEvent);
+        JTree jTree = guiInstance.getMainFrame().getTree();
         if (expandTree && !merging) { // don't automatically expand when merging
-            JTree jTree = guiInstance.getMainFrame().getTree();
-               for(int i = 0; i < jTree.getRowCount(); i++) {
-                 jTree.expandRow(i);
-               }
+            for(int i = 0; i < jTree.getRowCount(); i++) {
+                jTree.expandRow(i);
+            }
+        } else {
+            jTree.expandRow(0);
         }
-
+        TreePath path = jTree.getPathForRow(1);
+        jTree.setSelectionPath(path);
+        new FocusRequester(jTree);
         return isTestPlan;
     }
 

Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/gui/ThreadGroupGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/gui/ThreadGroupGui.java?rev=1302215&r1=1302214&r2=1302215&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/threads/gui/ThreadGroupGui.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/threads/gui/ThreadGroupGui.java Sun Mar 18 20:13:42
2012
@@ -31,7 +31,6 @@ import javax.swing.JTextField;
 
 import org.apache.jmeter.control.LoopController;
 import org.apache.jmeter.control.gui.LoopControlPanel;
-import org.apache.jmeter.gui.util.FocusRequester;
 import org.apache.jmeter.gui.util.JDateField;
 import org.apache.jmeter.gui.util.VerticalPanel;
 import org.apache.jmeter.testelement.TestElement;
@@ -240,7 +239,6 @@ public class ThreadGroupGui extends Abst
         threadPanel.add(threadInput, BorderLayout.CENTER);
 
         threadPropsPanel.add(threadPanel);
-        new FocusRequester(threadInput);
 
         // RAMP-UP
         JPanel rampPanel = new JPanel(new BorderLayout(5, 0));

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1302215&r1=1302214&r2=1302215&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sun Mar 18 20:13:42 2012
@@ -68,6 +68,9 @@ In User Defined Variables, Test Plan, HT
 empty Name and Value are no more saved.
 </p>
 
+<p>
+JMeter now expands the Test Plan tree to the testplan level and no further and selects the
root of the tree. Furthermore default value of onload.expandtree is false.
+</p>
 <!-- =================== Bug fixes =================== -->
 
 <h2>Bug fixes</h2>
@@ -176,6 +179,7 @@ empty Name and Value are no more saved.
 <li>Bug 52614 - MailerModel.sendMail has strange way to calculate debug setting</li>
 <li>Bug 52782 - Add a detail button on parameters table to show detail of a Row</li>
 <li>Bug 52674 - Proxy : Add a Sampler Creator to allow plugging HTTP based samplers
using potentially non textual POST Body (AMF, Silverlight...) and customizing them for others</li>
+<li>Bug 52934 - GUI : Open Test plan with the tree expanded to the testplan level and
no further and select the root of the tree</li>
 </ul>
 
 <h2>Non-functional changes</h2>



Mime
View raw message