Lines 20-25
package org.apache.jmeter.protocol.http.config.gui;
Link Here
|
20 |
|
20 |
|
21 |
import java.awt.BorderLayout; |
21 |
import java.awt.BorderLayout; |
22 |
import java.awt.Component; |
22 |
import java.awt.Component; |
|
|
23 |
import java.awt.event.ActionEvent; |
24 |
import java.awt.event.ActionListener; |
23 |
import java.awt.FlowLayout; |
25 |
import java.awt.FlowLayout; |
24 |
import java.awt.Font; |
26 |
import java.awt.Font; |
25 |
|
27 |
|
Lines 27-32
import javax.swing.BorderFactory;
Link Here
|
27 |
import javax.swing.Box; |
29 |
import javax.swing.Box; |
28 |
import javax.swing.BoxLayout; |
30 |
import javax.swing.BoxLayout; |
29 |
import javax.swing.JCheckBox; |
31 |
import javax.swing.JCheckBox; |
|
|
32 |
import javax.swing.JComboBox; |
30 |
import javax.swing.JLabel; |
33 |
import javax.swing.JLabel; |
31 |
import javax.swing.JOptionPane; |
34 |
import javax.swing.JOptionPane; |
32 |
import javax.swing.JPanel; |
35 |
import javax.swing.JPanel; |
Lines 116-122
public class UrlConfigGui extends JPanel implements ChangeListener {
Link Here
|
116 |
|
119 |
|
117 |
private JCheckBox useBrowserCompatibleMultipartMode; |
120 |
private JCheckBox useBrowserCompatibleMultipartMode; |
118 |
|
121 |
|
119 |
private JLabeledChoice method; |
122 |
private JComboBox method; |
120 |
|
123 |
|
121 |
private JLabeledChoice httpImplementation; |
124 |
private JLabeledChoice httpImplementation; |
122 |
|
125 |
|
Lines 186-192
public class UrlConfigGui extends JPanel implements ChangeListener {
Link Here
|
186 |
if (notConfigOnly){ |
189 |
if (notConfigOnly){ |
187 |
followRedirects.setSelected(true); |
190 |
followRedirects.setSelected(true); |
188 |
autoRedirects.setSelected(false); |
191 |
autoRedirects.setSelected(false); |
189 |
method.setText(HTTPSamplerBase.DEFAULT_METHOD); |
192 |
method.setSelectedItem(HTTPSamplerBase.DEFAULT_METHOD); |
190 |
useKeepAlive.setSelected(true); |
193 |
useKeepAlive.setSelected(true); |
191 |
useMultipartForPost.setSelected(false); |
194 |
useMultipartForPost.setSelected(false); |
192 |
useBrowserCompatibleMultipartMode.setSelected(HTTPSamplerBase.BROWSER_COMPATIBLE_MULTIPART_MODE_DEFAULT); |
195 |
useBrowserCompatibleMultipartMode.setSelected(HTTPSamplerBase.BROWSER_COMPATIBLE_MULTIPART_MODE_DEFAULT); |
Lines 266-272
public class UrlConfigGui extends JPanel implements ChangeListener {
Link Here
|
266 |
element.setProperty(HTTPSamplerBase.CONTENT_ENCODING, contentEncoding.getText()); |
269 |
element.setProperty(HTTPSamplerBase.CONTENT_ENCODING, contentEncoding.getText()); |
267 |
element.setProperty(HTTPSamplerBase.PATH, path.getText()); |
270 |
element.setProperty(HTTPSamplerBase.PATH, path.getText()); |
268 |
if (notConfigOnly){ |
271 |
if (notConfigOnly){ |
269 |
element.setProperty(HTTPSamplerBase.METHOD, method.getText()); |
272 |
element.setProperty(HTTPSamplerBase.METHOD, (String) method.getSelectedItem()); |
270 |
element.setProperty(new BooleanProperty(HTTPSamplerBase.FOLLOW_REDIRECTS, followRedirects.isSelected())); |
273 |
element.setProperty(new BooleanProperty(HTTPSamplerBase.FOLLOW_REDIRECTS, followRedirects.isSelected())); |
271 |
element.setProperty(new BooleanProperty(HTTPSamplerBase.AUTO_REDIRECTS, autoRedirects.isSelected())); |
274 |
element.setProperty(new BooleanProperty(HTTPSamplerBase.AUTO_REDIRECTS, autoRedirects.isSelected())); |
272 |
element.setProperty(new BooleanProperty(HTTPSamplerBase.USE_KEEPALIVE, useKeepAlive.isSelected())); |
275 |
element.setProperty(new BooleanProperty(HTTPSamplerBase.USE_KEEPALIVE, useKeepAlive.isSelected())); |
Lines 352-358
public class UrlConfigGui extends JPanel implements ChangeListener {
Link Here
|
352 |
contentEncoding.setText(el.getPropertyAsString(HTTPSamplerBase.CONTENT_ENCODING)); |
355 |
contentEncoding.setText(el.getPropertyAsString(HTTPSamplerBase.CONTENT_ENCODING)); |
353 |
path.setText(el.getPropertyAsString(HTTPSamplerBase.PATH)); |
356 |
path.setText(el.getPropertyAsString(HTTPSamplerBase.PATH)); |
354 |
if (notConfigOnly){ |
357 |
if (notConfigOnly){ |
355 |
method.setText(el.getPropertyAsString(HTTPSamplerBase.METHOD)); |
358 |
method.setSelectedItem(el.getPropertyAsString(HTTPSamplerBase.METHOD)); |
356 |
followRedirects.setSelected(el.getPropertyAsBoolean(HTTPSamplerBase.FOLLOW_REDIRECTS)); |
359 |
followRedirects.setSelected(el.getPropertyAsBoolean(HTTPSamplerBase.FOLLOW_REDIRECTS)); |
357 |
autoRedirects.setSelected(el.getPropertyAsBoolean(HTTPSamplerBase.AUTO_REDIRECTS)); |
360 |
autoRedirects.setSelected(el.getPropertyAsBoolean(HTTPSamplerBase.AUTO_REDIRECTS)); |
358 |
useKeepAlive.setSelected(el.getPropertyAsBoolean(HTTPSamplerBase.USE_KEEPALIVE)); |
361 |
useKeepAlive.setSelected(el.getPropertyAsBoolean(HTTPSamplerBase.USE_KEEPALIVE)); |
Lines 625-634
public class UrlConfigGui extends JPanel implements ChangeListener {
Link Here
|
625 |
JLabel contentEncodingLabel = new JLabel(JMeterUtils.getResString("content_encoding")); // $NON-NLS-1$ |
628 |
JLabel contentEncodingLabel = new JLabel(JMeterUtils.getResString("content_encoding")); // $NON-NLS-1$ |
626 |
contentEncodingLabel.setLabelFor(contentEncoding); |
629 |
contentEncodingLabel.setLabelFor(contentEncoding); |
627 |
|
630 |
|
|
|
631 |
JPanel methodPanel = null; |
628 |
if (notConfigOnly){ |
632 |
if (notConfigOnly){ |
629 |
method = new JLabeledChoice(JMeterUtils.getResString("method"), // $NON-NLS-1$ |
633 |
methodPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
630 |
HTTPSamplerBase.getValidMethodsAsArray(), true); |
634 |
JLabel methodLabel = new JLabel(JMeterUtils.getResString("method")); // $NON-NLS-1$ |
631 |
method.addChangeListener(this); |
635 |
method = new JComboBox(HTTPSamplerBase.getValidMethodsAsArray()); |
|
|
636 |
method.setEditable(true); |
637 |
method.addActionListener(new ActionListener() { |
638 |
public void actionPerformed(ActionEvent e) { |
639 |
stateChanged(new ChangeEvent(e.getSource())); |
640 |
} |
641 |
}); |
642 |
methodPanel.add(methodLabel); |
643 |
methodPanel.add(method); |
632 |
} |
644 |
} |
633 |
|
645 |
|
634 |
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
646 |
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
Lines 641-647
public class UrlConfigGui extends JPanel implements ChangeListener {
Link Here
|
641 |
panel.add(Box.createHorizontalStrut(5)); |
653 |
panel.add(Box.createHorizontalStrut(5)); |
642 |
|
654 |
|
643 |
if (notConfigOnly){ |
655 |
if (notConfigOnly){ |
644 |
panel.add(method); |
656 |
panel.add(methodPanel); |
645 |
} |
657 |
} |
646 |
panel.setMinimumSize(panel.getPreferredSize()); |
658 |
panel.setMinimumSize(panel.getPreferredSize()); |
647 |
panel.add(Box.createHorizontalStrut(5)); |
659 |
panel.add(Box.createHorizontalStrut(5)); |
Lines 800-806
public class UrlConfigGui extends JPanel implements ChangeListener {
Link Here
|
800 |
} |
812 |
} |
801 |
// disable the multi-part if not a post request |
813 |
// disable the multi-part if not a post request |
802 |
else if(e.getSource() == method) { |
814 |
else if(e.getSource() == method) { |
803 |
boolean isPostMethod = HTTPConstants.POST.equals(method.getText()); |
815 |
boolean isPostMethod = HTTPConstants.POST.equals((String) method.getSelectedItem()); |
804 |
useMultipartForPost.setEnabled(isPostMethod); |
816 |
useMultipartForPost.setEnabled(isPostMethod); |
805 |
} |
817 |
} |
806 |
} |
818 |
} |