Search in sources :

Example 6 with VerticalLayout

use of org.apache.jorphan.gui.layout.VerticalLayout 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 7 with VerticalLayout

use of org.apache.jorphan.gui.layout.VerticalLayout in project jmeter by apache.

the class SMIMEAssertionGui method createSignerPanel.

private JPanel createSignerPanel() {
    JPanel panel = new JPanel();
    panel.setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString(// $NON-NLS-1$
    "smime_assertion_signer")));
    panel.setLayout(new VerticalLayout(5, VerticalLayout.LEFT));
    ButtonGroup buttonGroup = new ButtonGroup();
    buttonGroup.add(signerNoCheck);
    buttonGroup.add(signerCheckConstraints);
    buttonGroup.add(signerCheckByFile);
    panel.add(signerNoCheck);
    panel.add(signerCheckConstraints);
    signerCheckConstraints.addChangeListener(evt -> {
        boolean signerCC = signerCheckConstraints.isSelected();
        signerDnField.setEnabled(signerCC);
        signerSerialNumberField.setEnabled(signerCC);
        signerEmailField.setEnabled(signerCC);
        issuerDnField.setEnabled(signerCC);
    });
    Box box = Box.createHorizontalBox();
    // $NON-NLS-1$
    box.add(new JLabel(JMeterUtils.getResString("smime_assertion_signer_dn")));
    box.add(Box.createHorizontalStrut(5));
    box.add(signerDnField);
    panel.add(box);
    box = Box.createHorizontalBox();
    // $NON-NLS-1$
    box.add(new JLabel(JMeterUtils.getResString("smime_assertion_signer_email")));
    box.add(Box.createHorizontalStrut(5));
    box.add(signerEmailField);
    panel.add(box);
    box = Box.createHorizontalBox();
    // $NON-NLS-1$
    box.add(new JLabel(JMeterUtils.getResString("smime_assertion_issuer_dn")));
    box.add(Box.createHorizontalStrut(5));
    box.add(issuerDnField);
    panel.add(box);
    box = Box.createHorizontalBox();
    // $NON-NLS-1$
    box.add(new JLabel(JMeterUtils.getResString("smime_assertion_signer_serial")));
    box.add(Box.createHorizontalStrut(5));
    box.add(signerSerialNumberField);
    panel.add(box);
    signerCheckByFile.addChangeListener(evt -> signerCertFile.setEnabled(signerCheckByFile.isSelected()));
    box = Box.createHorizontalBox();
    box.add(signerCheckByFile);
    box.add(Box.createHorizontalStrut(5));
    box.add(signerCertFile);
    panel.add(box);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) ButtonGroup(javax.swing.ButtonGroup) VerticalLayout(org.apache.jorphan.gui.layout.VerticalLayout) JLabel(javax.swing.JLabel) Box(javax.swing.Box) JCheckBox(javax.swing.JCheckBox)

Example 8 with VerticalLayout

use of org.apache.jorphan.gui.layout.VerticalLayout in project jmeter by apache.

the class SizeAssertionGui method init.

private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
    setBorder(makeBorder());
    add(makeTitlePanel());
    add(createScopePanel(true));
    add(createFieldPanel());
    // USER_INPUT
    JPanel sizePanel = new JPanel();
    sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), //$NON-NLS-1$
    JMeterUtils.getResString("size_assertion_size_test")));
    //$NON-NLS-1$
    sizePanel.add(new JLabel(JMeterUtils.getResString("size_assertion_label")));
    size = new JTextField(12);
    sizePanel.add(size);
    sizePanel.add(createComparatorButtonPanel());
    add(sizePanel);
}
Also used : JPanel(javax.swing.JPanel) VerticalLayout(org.apache.jorphan.gui.layout.VerticalLayout) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField)

Example 9 with VerticalLayout

use of org.apache.jorphan.gui.layout.VerticalLayout in project jmeter by apache.

the class TestActionGui method init.

private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
    setBorder(makeBorder());
    add(makeTitlePanel());
    // Target
    HorizontalPanel targetPanel = new HorizontalPanel();
    targetPanel.add(new JLabel(targetLabel));
    DefaultComboBoxModel<String> targetModel = new DefaultComboBoxModel<>();
    targetModel.addElement(threadTarget);
    targetModel.addElement(testTarget);
    targetBox = new JComboBox<>(targetModel);
    targetBox.addActionListener(evt -> {
        if (((String) targetBox.getSelectedItem()).equals(threadTarget)) {
            target = TestAction.THREAD;
        } else {
            target = TestAction.TEST;
        }
    });
    targetPanel.add(targetBox);
    add(targetPanel);
    // Action
    HorizontalPanel actionPanel = new HorizontalPanel();
    ButtonGroup actionButtons = new ButtonGroup();
    pauseButton = new JRadioButton(pauseAction, true);
    pauseButton.addChangeListener(evt -> {
        if (pauseButton.isSelected()) {
            action = TestAction.PAUSE;
            durationField.setEnabled(true);
            targetBox.setEnabled(true);
        }
    });
    stopButton = new JRadioButton(stopAction, false);
    stopButton.addChangeListener(evt -> {
        if (stopButton.isSelected()) {
            action = TestAction.STOP;
            durationField.setEnabled(false);
            targetBox.setEnabled(true);
        }
    });
    stopNowButton = new JRadioButton(stopNowAction, false);
    stopNowButton.addChangeListener(evt -> {
        if (stopNowButton.isSelected()) {
            action = TestAction.STOP_NOW;
            durationField.setEnabled(false);
            targetBox.setEnabled(true);
        }
    });
    restartNextLoopButton = new JRadioButton(restartNextLoopAction, false);
    restartNextLoopButton.addChangeListener(evt -> {
        if (restartNextLoopButton.isSelected()) {
            action = TestAction.RESTART_NEXT_LOOP;
            durationField.setEnabled(false);
            targetBox.setSelectedIndex(TestAction.THREAD);
            targetBox.setEnabled(false);
        }
    });
    actionButtons.add(pauseButton);
    actionButtons.add(stopButton);
    actionButtons.add(stopNowButton);
    actionButtons.add(restartNextLoopButton);
    actionPanel.add(new JLabel(actionLabel));
    actionPanel.add(pauseButton);
    actionPanel.add(stopButton);
    actionPanel.add(stopNowButton);
    actionPanel.add(restartNextLoopButton);
    add(actionPanel);
    // Duration
    HorizontalPanel durationPanel = new HorizontalPanel();
    durationField = new JTextField(15);
    // $NON-NLS-1$
    durationField.setText("");
    durationPanel.add(new JLabel(durationLabel));
    durationPanel.add(durationField);
    add(durationPanel);
}
Also used : JRadioButton(javax.swing.JRadioButton) ButtonGroup(javax.swing.ButtonGroup) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) VerticalLayout(org.apache.jorphan.gui.layout.VerticalLayout) JLabel(javax.swing.JLabel) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) JTextField(javax.swing.JTextField)

Example 10 with VerticalLayout

use of org.apache.jorphan.gui.layout.VerticalLayout 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);
}
Also used : JCheckBox(javax.swing.JCheckBox) JLabeledTextField(org.apache.jorphan.gui.JLabeledTextField) VerticalLayout(org.apache.jorphan.gui.layout.VerticalLayout)

Aggregations

VerticalLayout (org.apache.jorphan.gui.layout.VerticalLayout)21 JCheckBox (javax.swing.JCheckBox)12 JLabel (javax.swing.JLabel)11 JPanel (javax.swing.JPanel)11 JTextField (javax.swing.JTextField)8 BorderLayout (java.awt.BorderLayout)6 FlowLayout (java.awt.FlowLayout)4 Box (javax.swing.Box)4 Dimension (java.awt.Dimension)3 BoxLayout (javax.swing.BoxLayout)2 ButtonGroup (javax.swing.ButtonGroup)2 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)2 JButton (javax.swing.JButton)2 HorizontalPanel (org.apache.jmeter.gui.util.HorizontalPanel)2 PowerTableModel (org.apache.jmeter.gui.util.PowerTableModel)2 JLabeledTextField (org.apache.jorphan.gui.JLabeledTextField)2 Color (java.awt.Color)1 Format (java.text.Format)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Comparator (java.util.Comparator)1