You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by se...@apache.org on 2016/03/09 03:04:56 UTC
svn commit: r1734185 - in /jmeter/trunk/src:
jorphan/org/apache/jorphan/gui/JLabeledChoice.java
protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java
Author: sebb
Date: Wed Mar 9 02:04:56 2016
New Revision: 1734185
URL: http://svn.apache.org/viewvc?rev=1734185&view=rev
Log:
HTTP Request : Make Method field editable so that additional methods (Webdav) can be added easily
Don't display Add/Del buttons
Bugzilla Id: 59083
Modified:
jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java
Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java?rev=1734185&r1=1734184&r2=1734185&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/gui/JLabeledChoice.java Wed Mar 9 02:04:56 2016
@@ -41,6 +41,8 @@ public class JLabeledChoice extends JPan
private final JLabel mLabel = new JLabel();
private final JComboBox<String> choiceList;
+
+ private final boolean withButtons;
private final ArrayList<ChangeListener> mChangeListeners = new ArrayList<>(3);
@@ -52,6 +54,7 @@ public class JLabeledChoice extends JPan
public JLabeledChoice() {
super();
choiceList = new JComboBox<>();
+ withButtons = false;
init();
}
@@ -60,6 +63,7 @@ public class JLabeledChoice extends JPan
choiceList = new JComboBox<>();
mLabel.setText(pLabel);
choiceList.setEditable(editable);
+ withButtons = false;
init();
}
@@ -82,10 +86,24 @@ public class JLabeledChoice extends JPan
*
*/
public JLabeledChoice(String pLabel, String[] items, boolean editable) {
+ this(pLabel, items, editable, editable);
+ }
+
+ /**
+ * Constructs a combo-box with the label displaying the passed text.
+ *
+ * @param pLabel - the text to display in the label.
+ * @param items - the items to display in the Combo box
+ * @param editable - the box is made editable
+ * @param withButtons - if true, then Add and Delete buttons are created.
+ *
+ */
+ public JLabeledChoice(String pLabel, String[] items, boolean editable, boolean withButtons) {
super();
mLabel.setText(pLabel);
choiceList = new JComboBox<>(items);
choiceList.setEditable(editable);
+ this.withButtons = withButtons;
init();
}
@@ -141,7 +159,7 @@ public class JLabeledChoice extends JPan
// Add the sub components
this.add(mLabel);
this.add(choiceList);
- if (choiceList.isEditable()) {
+ if (withButtons) {
add = new JButton("Add");
add.setMargin(new Insets(1, 1, 1, 1));
add.addActionListener(new AddListener());
Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java?rev=1734185&r1=1734184&r2=1734185&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java Wed Mar 9 02:04:56 2016
@@ -627,7 +627,7 @@ public class UrlConfigGui extends JPanel
if (notConfigOnly){
method = new JLabeledChoice(JMeterUtils.getResString("method"), // $NON-NLS-1$
- HTTPSamplerBase.getValidMethodsAsArray(), true);
+ HTTPSamplerBase.getValidMethodsAsArray(), true, false);
method.addChangeListener(this);
}