Search in sources :

Example 1 with JLabeledChoice

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);
}
Also used : JLabeledChoice(org.apache.jorphan.gui.JLabeledChoice)

Example 2 with JLabeledChoice

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;
}
Also used : JPanel(javax.swing.JPanel) JLabeledTextField(org.apache.jorphan.gui.JLabeledTextField) GridBagConstraints(java.awt.GridBagConstraints) JTextArea(javax.swing.JTextArea) GridBagLayout(java.awt.GridBagLayout) JLabeledChoice(org.apache.jorphan.gui.JLabeledChoice) BorderLayout(java.awt.BorderLayout) JButton(javax.swing.JButton) EmptyBorder(javax.swing.border.EmptyBorder) Border(javax.swing.border.Border) EmptyBorder(javax.swing.border.EmptyBorder)

Example 3 with JLabeledChoice

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);
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) JLabeledChoice(org.apache.jorphan.gui.JLabeledChoice) HC4CookieHandler(org.apache.jmeter.protocol.http.control.HC4CookieHandler) BorderLayout(java.awt.BorderLayout) PowerTableModel(org.apache.jmeter.gui.util.PowerTableModel) VerticalLayout(org.apache.jorphan.gui.layout.VerticalLayout)

Example 4 with JLabeledChoice

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;
}
Also used : VerticalPanel(org.apache.jmeter.gui.util.VerticalPanel) JLabeledChoice(org.apache.jorphan.gui.JLabeledChoice) ArrayList(java.util.ArrayList) JavaSamplerClient(org.apache.jmeter.protocol.java.sampler.JavaSamplerClient) Font(java.awt.Font)

Aggregations

JLabeledChoice (org.apache.jorphan.gui.JLabeledChoice)4 BorderLayout (java.awt.BorderLayout)2 JPanel (javax.swing.JPanel)2 FlowLayout (java.awt.FlowLayout)1 Font (java.awt.Font)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 ArrayList (java.util.ArrayList)1 JButton (javax.swing.JButton)1 JCheckBox (javax.swing.JCheckBox)1 JTextArea (javax.swing.JTextArea)1 Border (javax.swing.border.Border)1 EmptyBorder (javax.swing.border.EmptyBorder)1 PowerTableModel (org.apache.jmeter.gui.util.PowerTableModel)1 VerticalPanel (org.apache.jmeter.gui.util.VerticalPanel)1 HC4CookieHandler (org.apache.jmeter.protocol.http.control.HC4CookieHandler)1 JavaSamplerClient (org.apache.jmeter.protocol.java.sampler.JavaSamplerClient)1 JLabeledTextField (org.apache.jorphan.gui.JLabeledTextField)1 VerticalLayout (org.apache.jorphan.gui.layout.VerticalLayout)1