Search in sources :

Example 21 with HorizontalPanel

use of org.apache.jmeter.gui.util.HorizontalPanel 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;
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) JLabeledTextField(org.apache.jorphan.gui.JLabeledTextField) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField)

Example 22 with HorizontalPanel

use of org.apache.jmeter.gui.util.HorizontalPanel in project jmeter by apache.

the class FtpConfigGui method init.

private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new BorderLayout(0, 5));
    if (displayName) {
        setBorder(makeBorder());
        add(makeTitlePanel(), BorderLayout.NORTH);
    }
    // MAIN PANEL
    VerticalPanel mainPanel = new VerticalPanel();
    JPanel serverPanel = new HorizontalPanel();
    serverPanel.add(createServerPanel(), BorderLayout.CENTER);
    serverPanel.add(getPortPanel(), BorderLayout.EAST);
    mainPanel.add(serverPanel);
    mainPanel.add(createRemoteFilenamePanel());
    mainPanel.add(createLocalFilenamePanel());
    mainPanel.add(createLocalFileContentsPanel());
    mainPanel.add(createOptionsPanel());
    add(mainPanel, BorderLayout.CENTER);
}
Also used : JPanel(javax.swing.JPanel) VerticalPanel(org.apache.jmeter.gui.util.VerticalPanel) BorderLayout(java.awt.BorderLayout) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel)

Example 23 with HorizontalPanel

use of org.apache.jmeter.gui.util.HorizontalPanel in project jmeter by apache.

the class MD5HexAssertionGUI method init.

private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new BorderLayout(0, 10));
    setBorder(makeBorder());
    add(makeTitlePanel(), BorderLayout.NORTH);
    JPanel mainPanel = new JPanel(new BorderLayout());
    // USER_INPUT
    HorizontalPanel md5HexPanel = new HorizontalPanel();
    md5HexPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
    JMeterUtils.getResString("md5hex_assertion_md5hex_test")));
    //$NON-NLS-1$
    md5HexPanel.add(new JLabel(JMeterUtils.getResString("md5hex_assertion_label")));
    md5HexInput = new JTextField(25);
    md5HexPanel.add(md5HexInput);
    mainPanel.add(md5HexPanel, BorderLayout.NORTH);
    add(mainPanel, BorderLayout.CENTER);
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField)

Example 24 with HorizontalPanel

use of org.apache.jmeter.gui.util.HorizontalPanel in project jmeter by apache.

the class XMLSchemaAssertionGUI method init.

/**
     * Inits the GUI.
     */
private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new BorderLayout(0, 10));
    setBorder(makeBorder());
    add(makeTitlePanel(), BorderLayout.NORTH);
    JPanel mainPanel = new JPanel(new BorderLayout());
    // USER_INPUT
    VerticalPanel assertionPanel = new VerticalPanel();
    assertionPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "XML Schema"));
    // doctype
    HorizontalPanel xmlSchemaPanel = new HorizontalPanel();
    //$NON-NLS-1$
    xmlSchemaPanel.add(new JLabel(JMeterUtils.getResString("xmlschema_assertion_label")));
    xmlSchema = new JTextField(26);
    xmlSchemaPanel.add(xmlSchema);
    assertionPanel.add(xmlSchemaPanel);
    mainPanel.add(assertionPanel, BorderLayout.NORTH);
    add(mainPanel, BorderLayout.CENTER);
}
Also used : JPanel(javax.swing.JPanel) VerticalPanel(org.apache.jmeter.gui.util.VerticalPanel) BorderLayout(java.awt.BorderLayout) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField)

Example 25 with HorizontalPanel

use of org.apache.jmeter.gui.util.HorizontalPanel in project jmeter by apache.

the class HTMLAssertionGui method init.

/**
     * Inits the GUI.
     */
private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new BorderLayout(0, 10));
    setBorder(makeBorder());
    add(makeTitlePanel(), BorderLayout.NORTH);
    JPanel mainPanel = new JPanel(new BorderLayout());
    // USER_INPUT
    VerticalPanel assertionPanel = new VerticalPanel();
    assertionPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Tidy Settings"));
    // doctype
    HorizontalPanel docTypePanel = new HorizontalPanel();
    docTypeBox = new JComboBox<>(new String[] { "omit", "auto", "strict", "loose" });
    // docTypePanel.add(new
    // JLabel(JMeterUtils.getResString("duration_assertion_label"))); //$NON-NLS-1$
    docTypePanel.add(new JLabel("Doctype:"));
    docTypePanel.add(docTypeBox);
    assertionPanel.add(docTypePanel);
    // format (HTML, XHTML, XML)
    VerticalPanel formatPanel = new VerticalPanel();
    formatPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Format"));
    //$NON-NLS-1$
    htmlRadioButton = new JRadioButton("HTML", true);
    //$NON-NLS-1$
    xhtmlRadioButton = new JRadioButton("XHTML", false);
    //$NON-NLS-1$
    xmlRadioButton = new JRadioButton("XML", false);
    ButtonGroup buttonGroup = new ButtonGroup();
    buttonGroup.add(htmlRadioButton);
    buttonGroup.add(xhtmlRadioButton);
    buttonGroup.add(xmlRadioButton);
    formatPanel.add(htmlRadioButton);
    formatPanel.add(xhtmlRadioButton);
    formatPanel.add(xmlRadioButton);
    assertionPanel.add(formatPanel);
    // errors only
    errorsOnly = new JCheckBox("Errors only", false);
    errorsOnly.addActionListener(this);
    assertionPanel.add(errorsOnly);
    // thresholds
    HorizontalPanel thresholdPanel = new HorizontalPanel();
    thresholdPanel.add(new JLabel("Error threshold:"));
    // $NON-NLS-1$
    errorThresholdField = new JTextField("0", 5);
    errorThresholdField.setName(ERROR_THRESHOLD_FIELD);
    errorThresholdField.addKeyListener(this);
    thresholdPanel.add(errorThresholdField);
    thresholdPanel.add(new JLabel("Warning threshold:"));
    // $NON-NLS-1$
    warningThresholdField = new JTextField("0", 5);
    warningThresholdField.setName(WARNING_THRESHOLD_FIELD);
    warningThresholdField.addKeyListener(this);
    thresholdPanel.add(warningThresholdField);
    assertionPanel.add(thresholdPanel);
    // file panel
    //$NON-NLS-1$ //$NON-NLS-2$
    filePanel = new FilePanel(JMeterUtils.getResString("html_assertion_file"), ".txt");
    assertionPanel.add(filePanel);
    mainPanel.add(assertionPanel, BorderLayout.NORTH);
    add(mainPanel, BorderLayout.CENTER);
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) VerticalPanel(org.apache.jmeter.gui.util.VerticalPanel) JRadioButton(javax.swing.JRadioButton) BorderLayout(java.awt.BorderLayout) ButtonGroup(javax.swing.ButtonGroup) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) JLabel(javax.swing.JLabel) FilePanel(org.apache.jmeter.gui.util.FilePanel) JTextField(javax.swing.JTextField)

Aggregations

HorizontalPanel (org.apache.jmeter.gui.util.HorizontalPanel)37 JPanel (javax.swing.JPanel)30 JLabel (javax.swing.JLabel)17 BorderLayout (java.awt.BorderLayout)15 JTextField (javax.swing.JTextField)15 VerticalPanel (org.apache.jmeter.gui.util.VerticalPanel)11 JCheckBox (javax.swing.JCheckBox)10 Dimension (java.awt.Dimension)6 JLabeledTextField (org.apache.jorphan.gui.JLabeledTextField)6 ButtonGroup (javax.swing.ButtonGroup)5 JRadioButton (javax.swing.JRadioButton)4 GridBagConstraints (java.awt.GridBagConstraints)3 GridBagLayout (java.awt.GridBagLayout)3 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)3 FlowLayout (java.awt.FlowLayout)2 JPasswordField (javax.swing.JPasswordField)2 JScrollPane (javax.swing.JScrollPane)2 JTabbedPane (javax.swing.JTabbedPane)2 Color (java.awt.Color)1 Format (java.text.Format)1