Search in sources :

Example 96 with GridBagLayout

use of java.awt.GridBagLayout in project zaproxy by zaproxy.

the class OptionsSpiderPanel method getPanelSpider.

/**
	 * This method initializes the main panel containing all option controls.
	 * 
	 * @return the panel for the spider options.
	 */
private JPanel getPanelSpider() {
    if (panelSpider == null) {
        // Initialize the panel
        panelSpider = new JPanel(new BorderLayout());
        if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
            panelSpider.setSize(114, 150);
        }
        panelSpider.setName("");
        // Prepare the necessary labels
        JLabel domainsLabel = new JLabel();
        JLabel noThreadsLabel = new JLabel();
        JLabel maxDuration = new JLabel();
        JLabel maxDepthLabel = new JLabel();
        JLabel handleParametersLabel = new JLabel();
        maxDepthLabel.setText(Constant.messages.getString("spider.options.label.depth"));
        noThreadsLabel.setText(Constant.messages.getString("spider.options.label.threads"));
        maxDuration.setText(Constant.messages.getString("spider.options.label.duration"));
        domainsLabel.setText(Constant.messages.getString("spider.options.label.domains"));
        handleParametersLabel.setText(Constant.messages.getString("spider.options.label.handleparameters"));
        JPanel innerPanel = new JPanel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.weightx = 1.0D;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        gbc.anchor = GridBagConstraints.NORTHWEST;
        Insets insets = new Insets(2, 2, 2, 2);
        gbc.insets = insets;
        // Add the components on the panel
        innerPanel.add(maxDepthLabel, gbc);
        innerPanel.add(getSliderMaxDepth(), gbc);
        innerPanel.add(noThreadsLabel, gbc);
        innerPanel.add(getSliderThreads(), gbc);
        JPanel inlineOptionsPanel = new JPanel(new GridBagLayout());
        inlineOptionsPanel.add(maxDuration, LayoutHelper.getGBC(0, 0, 1, 1.0D));
        inlineOptionsPanel.add(getDurationNumberSpinner(), LayoutHelper.getGBC(1, 0, 1, 1.0D));
        inlineOptionsPanel.add(new JLabel(Constant.messages.getString("spider.options.label.maxChildren")), LayoutHelper.getGBC(0, 1, 1, 1.0D));
        inlineOptionsPanel.add(getMaxChildrenNumberSpinner(), LayoutHelper.getGBC(1, 1, 1, 1.0D));
        innerPanel.add(inlineOptionsPanel, gbc);
        innerPanel.add(domainsLabel, gbc);
        gbc.fill = GridBagConstraints.BOTH;
        gbc.weighty = 1.0D;
        innerPanel.add(getDomainsAlwaysInScopePanel(), gbc);
        gbc.fill = GridBagConstraints.HORIZONTAL;
        gbc.weighty = 0;
        innerPanel.add(getChkSendRefererHeader(), gbc);
        innerPanel.add(handleParametersLabel, gbc);
        innerPanel.add(getComboHandleParameters(), gbc);
        innerPanel.add(getChkProcessForm(), gbc);
        insets.left = 15;
        innerPanel.add(getChkPostForm(), gbc);
        insets.left = 2;
        innerPanel.add(getChkParseComments(), gbc);
        innerPanel.add(getChkParseRobotsTxt(), gbc);
        innerPanel.add(getChkParseSitemapXml(), gbc);
        innerPanel.add(getChkParseSVNEntries(), gbc);
        innerPanel.add(getChkParseGit(), gbc);
        innerPanel.add(getHandleODataSpecificParameters(), gbc);
        JScrollPane scrollPane = new JScrollPane(innerPanel);
        scrollPane.setBorder(BorderFactory.createEmptyBorder());
        panelSpider.add(scrollPane, BorderLayout.CENTER);
    }
    return panelSpider;
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) BorderLayout(java.awt.BorderLayout) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel)

Example 97 with GridBagLayout

use of java.awt.GridBagLayout in project zaproxy by zaproxy.

the class OptionsStatsPanel method getPanelMisc.

/**
	 * This method initializes panelMisc	
	 * 	
	 * @return javax.swing.JPanel	
	 */
private JPanel getPanelMisc() {
    if (panelMisc == null) {
        panelMisc = new JPanel();
        panelMisc.setLayout(new GridBagLayout());
        panelMisc.add(getInMemoryStatsEnabledField(), LayoutHelper.getGBC(0, 0, 1, 0.5));
        panelMisc.add(getStatsdStatsEnabledField(), LayoutHelper.getGBC(0, 1, 1, 0.5));
        JPanel statsdPanel = new JPanel();
        statsdPanel.setLayout(new GridBagLayout());
        statsdPanel.setBorder(BorderFactory.createTitledBorder(null, Constant.messages.getString("stats.options.statsd.panel"), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, FontUtils.getFont(FontUtils.Size.standard), Color.black));
        statsdPanel.add(new JLabel(Constant.messages.getString("stats.options.label.statsd.host")), LayoutHelper.getGBC(0, 1, 1, 0.5));
        statsdPanel.add(this.getStatsdHostField(), LayoutHelper.getGBC(1, 1, 1, 0.5));
        statsdPanel.add(new JLabel(Constant.messages.getString("stats.options.label.statsd.port")), LayoutHelper.getGBC(0, 2, 1, 0.5));
        statsdPanel.add(this.getStatsdPortField(), LayoutHelper.getGBC(1, 2, 1, 0.5));
        statsdPanel.add(new JLabel(Constant.messages.getString("stats.options.label.statsd.prefix")), LayoutHelper.getGBC(0, 3, 1, 0.5));
        statsdPanel.add(this.getStatsdPrefixField(), LayoutHelper.getGBC(1, 3, 1, 0.5));
        panelMisc.add(statsdPanel, LayoutHelper.getGBC(0, 2, 1, 1.0D));
        // Spacer
        panelMisc.add(new JLabel(), LayoutHelper.getGBC(0, 10, 1, 0.5D, 1.0D));
    }
    return panelMisc;
}
Also used : JPanel(javax.swing.JPanel) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel)

Example 98 with GridBagLayout

use of java.awt.GridBagLayout in project zaproxy by zaproxy.

the class ContextUsersPanel method initialize.

private void initialize() {
    this.setLayout(new CardLayout());
    this.setName(getPanelName(getContextIndex()));
    this.setLayout(new GridBagLayout());
    this.add(new JLabel(Constant.messages.getString("users.panel.description")), LayoutHelper.getGBC(0, 0, 1, 1.0d, 0.0d));
    usersTableModel = new UsersTableModel();
    usersOptionsPanel = new UsersMultipleOptionsPanel(this.extension, usersTableModel, getContextIndex());
    this.add(usersOptionsPanel, LayoutHelper.getGBC(0, 1, 1, 1.0d, 1.0d));
}
Also used : CardLayout(java.awt.CardLayout) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel)

Example 99 with GridBagLayout

use of java.awt.GridBagLayout in project zaproxy by zaproxy.

the class DialogAddUser method getFieldsPanel.

@Override
protected JPanel getFieldsPanel() {
    if (fieldsPanel == null) {
        fieldsPanel = new JPanel();
        fieldsPanel.setLayout(new GridBagLayout());
        fieldsPanel.setName("DialogAddUser");
        Insets insets = new Insets(4, 8, 2, 4);
        JLabel nameLabel = new JLabel(Constant.messages.getString("users.dialog.add.field.label.name"));
        JLabel enabledLabel = new JLabel(Constant.messages.getString("users.dialog.add.field.label.enabled"));
        fieldsPanel.add(nameLabel, LayoutHelper.getGBC(0, 0, 1, 0.5D, insets));
        fieldsPanel.add(getNameTextField(), LayoutHelper.getGBC(1, 0, 1, 0.5D, insets));
        fieldsPanel.add(enabledLabel, LayoutHelper.getGBC(0, 1, 1, 0.5D, insets));
        fieldsPanel.add(getEnabledCheckBox(), LayoutHelper.getGBC(1, 1, 1, 0.5D, insets));
        fieldsPanel.add(new JSeparator(), LayoutHelper.getGBC(0, 2, 2, 0.5D, insets));
    }
    return fieldsPanel;
}
Also used : JPanel(javax.swing.JPanel) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) JSeparator(javax.swing.JSeparator)

Example 100 with GridBagLayout

use of java.awt.GridBagLayout in project zaproxy by zaproxy.

the class ContextExcludePanel method getPanelSession.

/**
	 * This method initializes panelSession	
	 * 	
	 * @return javax.swing.JPanel	
	 */
private JPanel getPanelSession() {
    if (panelSession == null) {
        panelSession = new JPanel();
        panelSession.setLayout(new GridBagLayout());
        panelSession.setName("ExcludeFromScope");
        java.awt.GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
        java.awt.GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
        javax.swing.JLabel jLabel = new JLabel();
        jLabel.setText(Constant.messages.getString("context.label.exclude"));
        gridBagConstraints1.gridx = 0;
        gridBagConstraints1.gridy = 0;
        gridBagConstraints1.gridheight = 1;
        gridBagConstraints1.insets = new java.awt.Insets(10, 0, 5, 0);
        gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints1.weightx = 0.0D;
        gridBagConstraints2.gridx = 0;
        gridBagConstraints2.gridy = 1;
        gridBagConstraints2.weightx = 1.0;
        gridBagConstraints2.weighty = 1.0;
        gridBagConstraints2.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints2.ipadx = 0;
        gridBagConstraints2.insets = new java.awt.Insets(0, 0, 0, 0);
        gridBagConstraints2.anchor = java.awt.GridBagConstraints.NORTHWEST;
        panelSession.add(jLabel, gridBagConstraints1);
        panelSession.add(regexesPanel, gridBagConstraints2);
    }
    return panelSession;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) JLabel(javax.swing.JLabel) GridBagConstraints(java.awt.GridBagConstraints)

Aggregations

GridBagLayout (java.awt.GridBagLayout)438 GridBagConstraints (java.awt.GridBagConstraints)280 JPanel (javax.swing.JPanel)275 JLabel (javax.swing.JLabel)243 Insets (java.awt.Insets)181 Dimension (java.awt.Dimension)125 JButton (javax.swing.JButton)110 JScrollPane (javax.swing.JScrollPane)94 ActionEvent (java.awt.event.ActionEvent)87 ActionListener (java.awt.event.ActionListener)69 BorderLayout (java.awt.BorderLayout)57 BoxLayout (javax.swing.BoxLayout)57 JCheckBox (javax.swing.JCheckBox)44 JTextField (javax.swing.JTextField)42 FlowLayout (java.awt.FlowLayout)32 ButtonGroup (javax.swing.ButtonGroup)31 JComboBox (javax.swing.JComboBox)24 ImageIcon (javax.swing.ImageIcon)20 TitledBorder (javax.swing.border.TitledBorder)20 WindowEvent (java.awt.event.WindowEvent)19