Search in sources :

Example 61 with EmptyBorder

use of javax.swing.border.EmptyBorder 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 62 with EmptyBorder

use of javax.swing.border.EmptyBorder in project jmeter by apache.

the class RenderAsXPath method createXpathExtractorTasksPanel.

/**
     * Create the XPath task pane
     *
     * @return XPath task pane
     */
private JPanel createXpathExtractorTasksPanel() {
    Box xpathActionPanel = Box.createVerticalBox();
    Box selectorAndButton = Box.createHorizontalBox();
    Border margin = new EmptyBorder(5, 5, 0, 5);
    xpathActionPanel.setBorder(margin);
    // $NON-NLS-1$
    xpathExpressionField = new JLabeledTextField(JMeterUtils.getResString("xpath_tester_field"));
    // $NON-NLS-1$
    JButton xpathTester = new JButton(JMeterUtils.getResString("xpath_tester_button_test"));
    xpathTester.setActionCommand(XPATH_TESTER_COMMAND);
    xpathTester.addActionListener(this);
    selectorAndButton.add(xpathExpressionField);
    selectorAndButton.add(xpathTester);
    xpathActionPanel.add(selectorAndButton);
    xpathActionPanel.add(xmlConfPanel);
    xpathActionPanel.add(getFragment);
    xpathResultField = new JTextArea();
    xpathResultField.setEditable(false);
    xpathResultField.setLineWrap(true);
    xpathResultField.setWrapStyleWord(true);
    JPanel xpathTasksPanel = new JPanel(new BorderLayout(0, 5));
    xpathTasksPanel.add(xpathActionPanel, BorderLayout.NORTH);
    xpathTasksPanel.add(GuiUtils.makeScrollPane(xpathResultField), BorderLayout.CENTER);
    return xpathTasksPanel;
}
Also used : JLabeledTextField(org.apache.jorphan.gui.JLabeledTextField) JPanel(javax.swing.JPanel) JTextArea(javax.swing.JTextArea) BorderLayout(java.awt.BorderLayout) JButton(javax.swing.JButton) Box(javax.swing.Box) JCheckBox(javax.swing.JCheckBox) EmptyBorder(javax.swing.border.EmptyBorder) Border(javax.swing.border.Border) EmptyBorder(javax.swing.border.EmptyBorder)

Example 63 with EmptyBorder

use of javax.swing.border.EmptyBorder in project intellij-community by JetBrains.

the class DetectionExcludesConfigurable method createComponent.

@Nls
@Override
@NotNull
public JComponent createComponent() {
    myEnabledDetectionCheckBox = new JCheckBox("Enable framework detection");
    myEnabledDetectionCheckBox.setBorder(new EmptyBorder(10, 10, 0, 0));
    final JBList excludesList = new JBList(myModel);
    final ColoredListCellRenderer renderer = new ColoredListCellRenderer() {

        JPanel panel = new JPanel(new BorderLayout());

        {
            panel.setBorder(new EmptyBorder(2, 10, 2, 0));
            panel.add(this);
        }

        @Override
        protected void customizeCellRenderer(@NotNull JList list, Object value, int index, boolean selected, boolean hasFocus) {
            setIconTextGap(4);
            if (value instanceof ExcludeListItem) {
                ((ExcludeListItem) value).renderItem(this);
                setBorder(new EmptyBorder(0, 10, 0, 0));
            }
        }

        @Override
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean selected, boolean hasFocus) {
            super.getListCellRendererComponent(list, value, index, selected, hasFocus);
            panel.setBackground(UIUtil.getListBackground(selected));
            return panel;
        }
    };
    renderer.setMyBorder(new EmptyBorder(0, 0, 0, 0));
    excludesList.setCellRenderer(renderer);
    final ToolbarDecorator decorator = ToolbarDecorator.createDecorator(excludesList).disableUpAction().disableDownAction().setAddAction(new AnActionButtonRunnable() {

        @Override
        public void run(AnActionButton button) {
            doAddAction(button);
        }
    });
    decorator.setPanelBorder(new CustomLineBorder(1, 0, 0, 0));
    myMainPanel = new JPanel(new BorderLayout(0, 5));
    myMainPanel.add(myEnabledDetectionCheckBox, BorderLayout.NORTH);
    final LabeledComponent<JPanel> excludesComponent = LabeledComponent.create(decorator.createPanel(), "   Exclude from detection:");
    myMainPanel.add(excludesComponent);
    myEnabledDetectionCheckBox.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            GuiUtils.enableChildren(myEnabledDetectionCheckBox.isSelected(), excludesComponent);
        }
    });
    myEnabledDetectionCheckBox.setSelected(true);
    return myMainPanel;
}
Also used : ActionEvent(java.awt.event.ActionEvent) NotNull(org.jetbrains.annotations.NotNull) CustomLineBorder(com.intellij.ui.border.CustomLineBorder) ActionListener(java.awt.event.ActionListener) JBList(com.intellij.ui.components.JBList) EmptyBorder(javax.swing.border.EmptyBorder) Nls(org.jetbrains.annotations.Nls) NotNull(org.jetbrains.annotations.NotNull)

Example 64 with EmptyBorder

use of javax.swing.border.EmptyBorder in project intellij-community by JetBrains.

the class CodeFragmentTableCellEditorBase method createEditorField.

protected EditorTextField createEditorField(Document document) {
    EditorTextField field = new EditorTextField(document, myProject, myFileType) {

        @Override
        protected boolean shouldHaveBorder() {
            return false;
        }
    };
    field.setBorder(new EmptyBorder(1, 1, 1, 1));
    return field;
}
Also used : EditorTextField(com.intellij.ui.EditorTextField) EmptyBorder(javax.swing.border.EmptyBorder)

Example 65 with EmptyBorder

use of javax.swing.border.EmptyBorder in project intellij-community by JetBrains.

the class CommonContentEntriesEditor method addContentEntryPanel.

protected void addContentEntryPanel(final String contentEntry) {
    final ContentEntryEditor contentEntryEditor = createContentEntryEditor(contentEntry);
    contentEntryEditor.initUI();
    contentEntryEditor.addContentEntryEditorListener(myContentEntryEditorListener);
    registerDisposable(new Disposable() {

        @Override
        public void dispose() {
            contentEntryEditor.removeContentEntryEditorListener(myContentEntryEditorListener);
        }
    });
    myEntryToEditorMap.put(contentEntry, contentEntryEditor);
    Border border = BorderFactory.createEmptyBorder(2, 2, 0, 2);
    final JComponent component = contentEntryEditor.getComponent();
    final Border componentBorder = component.getBorder();
    if (componentBorder != null) {
        border = BorderFactory.createCompoundBorder(border, componentBorder);
    }
    component.setBorder(new EmptyBorder(0, 0, 0, 0));
    myEditorsPanel.add(component);
}
Also used : Disposable(com.intellij.openapi.Disposable) EmptyBorder(javax.swing.border.EmptyBorder) Border(javax.swing.border.Border) EmptyBorder(javax.swing.border.EmptyBorder) CustomLineBorder(com.intellij.ui.border.CustomLineBorder)

Aggregations

EmptyBorder (javax.swing.border.EmptyBorder)224 JPanel (javax.swing.JPanel)96 BorderLayout (java.awt.BorderLayout)87 JLabel (javax.swing.JLabel)70 JButton (javax.swing.JButton)44 JScrollPane (javax.swing.JScrollPane)44 Insets (java.awt.Insets)37 Dimension (java.awt.Dimension)35 Border (javax.swing.border.Border)30 GridBagLayout (java.awt.GridBagLayout)29 ActionEvent (java.awt.event.ActionEvent)27 ActionListener (java.awt.event.ActionListener)27 TitledBorder (javax.swing.border.TitledBorder)25 GridBagConstraints (java.awt.GridBagConstraints)24 Box (javax.swing.Box)22 JTextField (javax.swing.JTextField)21 CompoundBorder (javax.swing.border.CompoundBorder)20 BoxLayout (javax.swing.BoxLayout)17 FlowLayout (java.awt.FlowLayout)16 JCheckBox (javax.swing.JCheckBox)16