Author: sebb
Date: Mon Apr 24 10:58:59 2006
New Revision: 396622
URL: http://svn.apache.org/viewcvs?rev=396622&view=rev
Log:
Expand tree by default when loading a test plan
Modified:
jakarta/jmeter/branches/rel-2-1/bin/jmeter.properties
jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/gui/action/Load.java
Modified: jakarta/jmeter/branches/rel-2-1/bin/jmeter.properties
URL:
http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/bin/jmeter.properties?rev=396622&r1=396621&r2=396622&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/bin/jmeter.properties (original)
+++ jakarta/jmeter/branches/rel-2-1/bin/jmeter.properties Mon Apr 24 10:58:59
2006
@@ -451,4 +451,7 @@
# Users can define additional classpath items by setting the property below
# Paths with spaces may cause problems for the JVM
-#user.classpath=../classes;../jars/jar1.jar
\ No newline at end of file
+#user.classpath=../classes;../jars/jar1.jar
+
+#Should JMeter expand the tree when loading a test plan?
+#onload.expandtree=false
\ No newline at end of file
Modified:
jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/gui/action/Load.java
URL:
http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/gui/action/Load.java?rev=396622&r1=396621&r2=396622&view=diff
==============================================================================
---
jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/gui/action/Load.java
(original)
+++
jakarta/jmeter/branches/rel-2-1/src/core/org/apache/jmeter/gui/action/Load.java
Mon Apr 24 10:58:59 2006
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2004 The Apache Software Foundation.
+ * Copyright 2001-2004,2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@
import java.util.Set;
import javax.swing.JFileChooser;
+import javax.swing.JTree;
import javax.swing.tree.TreePath;
import org.apache.jmeter.exceptions.IllegalUserActionException;
@@ -49,6 +50,8 @@
public class Load implements Command {
private static final Logger log = LoggingManager.getLoggerForClass();
+ private static final boolean expandTree =
JMeterUtils.getPropDefault("onload.expandtree", true);
+
private static Set commands = new HashSet();
static {
commands.add(ActionNames.OPEN);
@@ -141,6 +144,12 @@
tree = GuiPackage.getInstance().getCurrentSubTree();
ActionRouter.getInstance().actionPerformed(
new
ActionEvent(tree.get(tree.getArray()[tree.size() - 1]), id,
ActionNames.SUB_TREE_LOADED));
+ if (expandTree) {
+ JTree jTree =
GuiPackage.getInstance().getMainFrame().getTree();
+ for(int i = 0; i < jTree.getRowCount(); i++) {
+ jTree.expandRow(i);
+ }
+ }
return isTestPlan;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]