Search in sources :

Example 16 with HorizontalPanel

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

the class ProxyControlGui method createTargetPanel.

private JPanel createTargetPanel() {
    targetNodesModel = new DefaultComboBoxModel<>();
    targetNodes = new JComboBox<>(targetNodesModel);
    // $NON-NLS-1$ // Bug 56303 fixed the width of combo list
    targetNodes.setPrototypeDisplayValue("");
    // get popup element
    JPopupMenu popup = (JPopupMenu) targetNodes.getUI().getAccessibleChild(targetNodes, 0);
    JScrollPane scrollPane = findScrollPane(popup);
    if (scrollPane != null) {
        // add scroll pane if label element is too long
        scrollPane.setHorizontalScrollBar(new JScrollBar(JScrollBar.HORIZONTAL));
        scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    }
    targetNodes.setActionCommand(CHANGE_TARGET);
    // Action listener will be added later
    // $NON-NLS-1$
    JLabel label = new JLabel(JMeterUtils.getResString("proxy_target"));
    label.setLabelFor(targetNodes);
    HorizontalPanel panel = new HorizontalPanel();
    panel.add(label);
    panel.add(targetNodes);
    return panel;
}
Also used : JScrollPane(javax.swing.JScrollPane) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) JLabel(javax.swing.JLabel) JPopupMenu(javax.swing.JPopupMenu) JScrollBar(javax.swing.JScrollBar)

Example 17 with HorizontalPanel

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

the class JMSSamplerGui method init.

/**
     * Initializes the configuration screen.
     *
     */
private void init() {
    // WARNING: called from ctor so must not be overridden (i.e. must be private or final)
    setLayout(new BorderLayout());
    setBorder(makeBorder());
    add(makeTitlePanel(), BorderLayout.NORTH);
    JPanel jmsQueueingPanel = new JPanel(new BorderLayout());
    jmsQueueingPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), //$NON-NLS-1$
    JMeterUtils.getResString("jms_queueing")));
    JPanel qcfPanel = new JPanel(new BorderLayout(5, 0));
    qcfPanel.add(queueConnectionFactory, BorderLayout.CENTER);
    jmsQueueingPanel.add(qcfPanel, BorderLayout.NORTH);
    JPanel sendQueuePanel = new JPanel(new BorderLayout(5, 0));
    sendQueuePanel.add(sendQueue);
    jmsQueueingPanel.add(sendQueuePanel, BorderLayout.CENTER);
    JPanel receiveQueuePanel = new JPanel(new BorderLayout(5, 0));
    receiveQueuePanel.add(jmsSelector, BorderLayout.SOUTH);
    receiveQueuePanel.add(receiveQueue, BorderLayout.NORTH);
    jmsQueueingPanel.add(receiveQueuePanel, BorderLayout.SOUTH);
    JPanel messagePanel = new JPanel(new BorderLayout());
    messagePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), //$NON-NLS-1$
    JMeterUtils.getResString("jms_message_title")));
    JPanel correlationPanel = new HorizontalPanel();
    correlationPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), //$NON-NLS-1$
    JMeterUtils.getResString("jms_correlation_title")));
    //$NON-NLS-1$
    useReqMsgIdAsCorrelId = new JCheckBox(JMeterUtils.getResString("jms_use_req_msgid_as_correlid"), false);
    //$NON-NLS-1$
    useResMsgIdAsCorrelId = new JCheckBox(JMeterUtils.getResString("jms_use_res_msgid_as_correlid"), false);
    correlationPanel.add(useReqMsgIdAsCorrelId);
    correlationPanel.add(useResMsgIdAsCorrelId);
    JPanel messageNorthPanel = new JPanel(new BorderLayout());
    JPanel onewayPanel = new HorizontalPanel();
    onewayPanel.add(oneWay);
    onewayPanel.add(correlationPanel);
    messageNorthPanel.add(onewayPanel, BorderLayout.NORTH);
    //$NON-NLS-1$
    useNonPersistentDelivery = new JCheckBox(JMeterUtils.getResString("jms_use_non_persistent_delivery"), false);
    JPanel timeoutPanel = new HorizontalPanel();
    timeoutPanel.add(timeout);
    timeoutPanel.add(expiration);
    timeoutPanel.add(priority);
    timeoutPanel.add(useNonPersistentDelivery);
    messageNorthPanel.add(timeoutPanel, BorderLayout.SOUTH);
    messagePanel.add(messageNorthPanel, BorderLayout.NORTH);
    JPanel messageContentPanel = new JPanel(new BorderLayout());
    messageContentPanel.add(new JLabel(JMeterUtils.getResString("jms_msg_content")), BorderLayout.NORTH);
    messageContentPanel.add(JTextScrollPane.getInstance(messageContent), BorderLayout.CENTER);
    messagePanel.add(messageContentPanel, BorderLayout.CENTER);
    //$NON-NLS-1$
    jmsPropertiesPanel = new JMSPropertiesPanel();
    messagePanel.add(jmsPropertiesPanel, BorderLayout.SOUTH);
    Box mainPanel = Box.createVerticalBox();
    add(mainPanel, BorderLayout.CENTER);
    mainPanel.add(jmsQueueingPanel, BorderLayout.NORTH);
    mainPanel.add(messagePanel, BorderLayout.CENTER);
    JPanel jndiPanel = createJNDIPanel();
    mainPanel.add(jndiPanel, BorderLayout.SOUTH);
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) JLabel(javax.swing.JLabel) Box(javax.swing.Box) JCheckBox(javax.swing.JCheckBox) JComboBox(javax.swing.JComboBox)

Example 18 with HorizontalPanel

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

Example 19 with HorizontalPanel

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

the class HttpDefaultsGui method getImplementationPanel.

/**
     * Create a panel containing the implementation details
     *
     * @return the panel
     */
protected final JPanel getImplementationPanel() {
    JPanel implPanel = new HorizontalPanel();
    implPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
    JMeterUtils.getResString("web_server_client")));
    // $NON-NLS-1$
    implPanel.add(new JLabel(JMeterUtils.getResString("http_implementation")));
    // $NON-NLS-1$
    httpImplementation.addItem("");
    implPanel.add(httpImplementation);
    return implPanel;
}
Also used : JPanel(javax.swing.JPanel) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel) JLabel(javax.swing.JLabel)

Example 20 with HorizontalPanel

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

the class HttpDefaultsGui method getProxyServerPanel.

/**
     * Create a panel containing the proxy server details
     *
     * @return the panel
     */
protected final JPanel getProxyServerPanel() {
    JPanel proxyServer = new HorizontalPanel();
    proxyServer.add(getProxyHostPanel(), BorderLayout.CENTER);
    proxyServer.add(getProxyPortPanel(), BorderLayout.EAST);
    JPanel proxyLogin = new HorizontalPanel();
    proxyLogin.add(getProxyUserPanel());
    proxyLogin.add(getProxyPassPanel());
    JPanel proxyServerPanel = new HorizontalPanel();
    proxyServerPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), // $NON-NLS-1$
    JMeterUtils.getResString("web_proxy_server_title")));
    proxyServerPanel.add(proxyServer);
    proxyServerPanel.add(proxyLogin);
    return proxyServerPanel;
}
Also used : JPanel(javax.swing.JPanel) HorizontalPanel(org.apache.jmeter.gui.util.HorizontalPanel)

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