use of org.apache.jorphan.gui.JLabeledTextField in project jmeter by apache.
the class CounterConfigGui method init.
private void init() {
// WARNING: called from ctor so must not be overridden (i.e. must be private or final)
setBorder(makeBorder());
setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
//$NON-NLS-1$
startField = new JLabeledTextField(JMeterUtils.getResString("start"));
//$NON-NLS-1$
incrField = new JLabeledTextField(JMeterUtils.getResString("increment"));
//$NON-NLS-1$
endField = new JLabeledTextField(JMeterUtils.getResString("max"));
//$NON-NLS-1$
varNameField = new JLabeledTextField(JMeterUtils.getResString("var_name"));
//$NON-NLS-1$
formatField = new JLabeledTextField(JMeterUtils.getResString("format"));
//$NON-NLS-1$
perUserField = new JCheckBox(JMeterUtils.getResString("counter_per_user"));
//$NON-NLS-1$
resetCounterOnEachThreadGroupIteration = new JCheckBox(JMeterUtils.getResString("counter_reset_per_tg_iteration"));
add(makeTitlePanel());
add(startField);
add(incrField);
add(endField);
add(formatField);
add(varNameField);
add(CheckBoxPanel.wrap(perUserField));
add(CheckBoxPanel.wrap(resetCounterOnEachThreadGroupIteration));
perUserField.addActionListener(this);
}
use of org.apache.jorphan.gui.JLabeledTextField in project jmeter by apache.
the class RenderAsCssJQuery method createCssJqueryTasksPanel.
/**
* Create the CssJquery task pane
*
* @return CssJquery task pane
*/
private JPanel createCssJqueryTasksPanel() {
GridBagLayout g = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
JPanel cssJqueryActionPanel = new JPanel();
cssJqueryActionPanel.setLayout(g);
Border margin = new EmptyBorder(5, 5, 0, 5);
cssJqueryActionPanel.setBorder(margin);
// $NON-NLS-1$
cssJqueryField = new JLabeledTextField(JMeterUtils.getResString("cssjquery_tester_field"));
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 0;
cssJqueryActionPanel.add(cssJqueryField, c);
cssJqueryLabeledChoice = new JLabeledChoice(// $NON-NLS-1$
JMeterUtils.getResString("cssjquery_impl"), getImplementations());
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1;
c.gridy = 0;
cssJqueryActionPanel.add(cssJqueryLabeledChoice, c);
// $NON-NLS-1$
attributeField = new JLabeledTextField(JMeterUtils.getResString("cssjquery_attribute"));
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 1;
cssJqueryActionPanel.add(attributeField, c);
// $NON-NLS-1$
JButton cssJqueryTester = new JButton(JMeterUtils.getResString("cssjquery_tester_button_test"));
cssJqueryTester.setActionCommand(CSSJQUEY_TESTER_COMMAND);
cssJqueryTester.addActionListener(this);
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 1;
c.gridy = 1;
cssJqueryActionPanel.add(cssJqueryTester, c);
cssJqueryResultField = new JTextArea();
cssJqueryResultField.setEditable(false);
cssJqueryResultField.setLineWrap(true);
cssJqueryResultField.setWrapStyleWord(true);
JPanel cssJqueryTasksPanel = new JPanel(new BorderLayout(0, 5));
cssJqueryTasksPanel.add(cssJqueryActionPanel, BorderLayout.NORTH);
cssJqueryTasksPanel.add(GuiUtils.makeScrollPane(cssJqueryResultField), BorderLayout.CENTER);
return cssJqueryTasksPanel;
}
use of org.apache.jorphan.gui.JLabeledTextField in project jmeter by apache.
the class RenderAsXPath method createXpathExtractorTasksPanel.
/**
* Create the XPath task pane
*
* @return XPath task pane
*/
private JPanel createXpathExtractorTasksPanel() {
Box xpathActionPanel = Box.createVerticalBox();
Box selectorAndButton = Box.createHorizontalBox();
Border margin = new EmptyBorder(5, 5, 0, 5);
xpathActionPanel.setBorder(margin);
// $NON-NLS-1$
xpathExpressionField = new JLabeledTextField(JMeterUtils.getResString("xpath_tester_field"));
// $NON-NLS-1$
JButton xpathTester = new JButton(JMeterUtils.getResString("xpath_tester_button_test"));
xpathTester.setActionCommand(XPATH_TESTER_COMMAND);
xpathTester.addActionListener(this);
selectorAndButton.add(xpathExpressionField);
selectorAndButton.add(xpathTester);
xpathActionPanel.add(selectorAndButton);
xpathActionPanel.add(xmlConfPanel);
xpathActionPanel.add(getFragment);
xpathResultField = new JTextArea();
xpathResultField.setEditable(false);
xpathResultField.setLineWrap(true);
xpathResultField.setWrapStyleWord(true);
JPanel xpathTasksPanel = new JPanel(new BorderLayout(0, 5));
xpathTasksPanel.add(xpathActionPanel, BorderLayout.NORTH);
xpathTasksPanel.add(GuiUtils.makeScrollPane(xpathResultField), BorderLayout.CENTER);
return xpathTasksPanel;
}
use of org.apache.jorphan.gui.JLabeledTextField in project jmeter by apache.
the class UrlConfigGui method getPathPanel.
/**
* This method defines the Panel for:
* the HTTP path, Method and Content Encoding
* 'Follow Redirects', 'Use KeepAlive', and 'Use multipart for HTTP POST' elements.
*
* @return JPanel The Panel for the path, 'Follow Redirects' and 'Use
* KeepAlive' elements.
*/
protected Component getPathPanel() {
//$NON-NLS-1$
path = new JLabeledTextField(JMeterUtils.getResString("path"), 80);
// CONTENT_ENCODING
// $NON-NLS-1$
contentEncoding = new JLabeledTextField(JMeterUtils.getResString("content_encoding"), 7);
if (notConfigOnly) {
method = new // $NON-NLS-1$
JLabeledChoice(// $NON-NLS-1$
JMeterUtils.getResString("method"), HTTPSamplerBase.getValidMethodsAsArray(), true, false);
method.addChangeListener(this);
}
if (notConfigOnly) {
// $NON-NLS-1$
followRedirects = new JCheckBox(JMeterUtils.getResString("follow_redirects"));
followRedirects.setFont(null);
followRedirects.setSelected(true);
followRedirects.addChangeListener(this);
//$NON-NLS-1$
autoRedirects = new JCheckBox(JMeterUtils.getResString("follow_redirects_auto"));
autoRedirects.setFont(null);
autoRedirects.addChangeListener(this);
// Default changed in 2.3 and again in 2.4
autoRedirects.setSelected(false);
// $NON-NLS-1$
useKeepAlive = new JCheckBox(JMeterUtils.getResString("use_keepalive"));
useKeepAlive.setFont(null);
useKeepAlive.setSelected(true);
// $NON-NLS-1$
useMultipartForPost = new JCheckBox(JMeterUtils.getResString("use_multipart_for_http_post"));
useMultipartForPost.setFont(null);
useMultipartForPost.setSelected(false);
// $NON-NLS-1$
useBrowserCompatibleMultipartMode = new JCheckBox(JMeterUtils.getResString("use_multipart_mode_browser"));
useBrowserCompatibleMultipartMode.setFont(null);
useBrowserCompatibleMultipartMode.setSelected(HTTPSamplerBase.BROWSER_COMPATIBLE_MULTIPART_MODE_DEFAULT);
}
JPanel pathPanel = new HorizontalPanel();
pathPanel.setPreferredSize(new Dimension(80, 30));
if (notConfigOnly) {
pathPanel.add(method);
}
pathPanel.add(path);
pathPanel.add(contentEncoding);
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
panel.add(pathPanel);
if (notConfigOnly) {
JPanel optionPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
// all sub-components with setFont(null) inherit this font
optionPanel.setFont(FONT_SMALL);
optionPanel.add(autoRedirects);
optionPanel.add(followRedirects);
optionPanel.add(useKeepAlive);
optionPanel.add(useMultipartForPost);
optionPanel.add(useBrowserCompatibleMultipartMode);
optionPanel.setMinimumSize(optionPanel.getPreferredSize());
panel.add(optionPanel);
}
return panel;
}
use of org.apache.jorphan.gui.JLabeledTextField in project jmeter by apache.
the class HttpDefaultsGui method createEmbeddedRsrcPanel.
protected JPanel createEmbeddedRsrcPanel() {
// retrieve Embedded resources
// $NON-NLS-1$
retrieveEmbeddedResources = new JCheckBox(JMeterUtils.getResString("web_testing_retrieve_images"));
// add a listener to activate or not concurrent dwn.
retrieveEmbeddedResources.addItemListener(e -> {
if (e.getStateChange() == ItemEvent.SELECTED) {
enableConcurrentDwn(true);
} else {
enableConcurrentDwn(false);
}
});
// Download concurrent resources
// $NON-NLS-1$
concurrentDwn = new JCheckBox(JMeterUtils.getResString("web_testing_concurrent_download"));
concurrentDwn.addItemListener(e -> {
if (retrieveEmbeddedResources.isSelected() && e.getStateChange() == ItemEvent.SELECTED) {
concurrentPool.setEnabled(true);
} else {
concurrentPool.setEnabled(false);
}
});
// 2 columns size
concurrentPool = new JTextField(2);
concurrentPool.setMinimumSize(new Dimension(10, (int) concurrentPool.getPreferredSize().getHeight()));
concurrentPool.setMaximumSize(new Dimension(30, (int) concurrentPool.getPreferredSize().getHeight()));
final JPanel embeddedRsrcPanel = new HorizontalPanel();
embeddedRsrcPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString(// $NON-NLS-1$
"web_testing_retrieve_title")));
embeddedRsrcPanel.add(retrieveEmbeddedResources);
embeddedRsrcPanel.add(concurrentDwn);
embeddedRsrcPanel.add(concurrentPool);
// Embedded URL match regex
// $NON-NLS-1$
embeddedRE = new JLabeledTextField(JMeterUtils.getResString("web_testing_embedded_url_pattern"), 20);
embeddedRsrcPanel.add(embeddedRE);
return embeddedRsrcPanel;
}
Aggregations