use of org.apache.jorphan.gui.JLabeledChoice in project jmeter by apache.
the class FunctionHelper method initializeFunctionList.
private void initializeFunctionList() {
String[] functionNames = CompoundVariable.getFunctionNames();
Arrays.sort(functionNames, (o1, o2) -> o1.compareToIgnoreCase(o2));
//$NON-NLS-1$
functionList = new JLabeledChoice(JMeterUtils.getResString("choose_function"), functionNames);
functionList.addChangeListener(this);
}
use of org.apache.jorphan.gui.JLabeledChoice 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.JLabeledChoice in project jmeter by apache.
the class CookiePanel method init.
/**
* Shows the main cookie configuration panel.
*/
private void init() {
// WARNING: called from ctor so must not be overridden (i.e. must be private or final)
tableModel = new PowerTableModel(COLUMN_RESOURCE_NAMES, columnClasses);
clearEachIteration = //$NON-NLS-1$
new JCheckBox(JMeterUtils.getResString("clear_cookies_per_iter"), false);
policy = new JLabeledChoice(//$NON-NLS-1$
JMeterUtils.getResString("cookie_manager_policy"), new HC4CookieHandler().getPolicies());
setLayout(new BorderLayout());
setBorder(makeBorder());
JPanel northPanel = new JPanel();
northPanel.setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
northPanel.add(makeTitlePanel());
JPanel optionsPane = new JPanel();
optionsPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
JMeterUtils.getResString("cookie_options")));
optionsPane.setLayout(new VerticalLayout(5, VerticalLayout.BOTH));
optionsPane.add(clearEachIteration);
JPanel policyTypePane = new JPanel();
policyTypePane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
policyTypePane.add(policy);
optionsPane.add(policyTypePane);
northPanel.add(optionsPane);
add(northPanel, BorderLayout.NORTH);
add(createCookieTablePanel(), BorderLayout.CENTER);
}
use of org.apache.jorphan.gui.JLabeledChoice in project jmeter by apache.
the class JavaConfigGui method createClassnamePanel.
/**
* Create a panel with GUI components allowing the user to select a test
* class.
*
* @return a panel containing the relevant components
*/
private JPanel createClassnamePanel() {
List<String> possibleClasses = new ArrayList<>();
try {
// Find all the classes which implement the JavaSamplerClient
// interface.
possibleClasses = ClassFinder.findClassesThatExtend(JMeterUtils.getSearchPaths(), new Class[] { JavaSamplerClient.class });
// Remove the JavaConfig class from the list since it only
// implements the interface for error conditions.
possibleClasses.remove(JavaSampler.class.getName() + "$ErrorSamplerClient");
} catch (Exception e) {
log.debug("Exception getting interfaces.", e);
}
classNameLabeledChoice = new JLabeledChoice(JMeterUtils.getResString("protocol_java_classname"), possibleClasses.toArray(ArrayUtils.EMPTY_STRING_ARRAY), true, false);
classNameLabeledChoice.addChangeListener(this);
warningLabel.setForeground(Color.RED);
Font font = warningLabel.getFont();
warningLabel.setFont(new Font(font.getFontName(), Font.BOLD, (int) (font.getSize() * 1.1)));
warningLabel.setVisible(false);
VerticalPanel panel = new VerticalPanel();
panel.add(classNameLabeledChoice);
panel.add(warningLabel);
return panel;
}
Aggregations