Search in sources :

Example 66 with EmptyBorder

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

the class ContentRootPanel method initUI.

public void initUI() {
    myHeader = createHeader();
    myHeader.setBorder(new EmptyBorder(0, 8, 0, 0));
    this.add(myHeader, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.insetsBottom(8), 0, 0));
    addFolderGroupComponents();
    myBottom = new JPanel(new BorderLayout());
    myBottom.add(Box.createVerticalStrut(3), BorderLayout.NORTH);
    this.add(myBottom, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, JBUI.emptyInsets(), 0, 0));
    setSelected(false);
}
Also used : EmptyBorder(javax.swing.border.EmptyBorder)

Example 67 with EmptyBorder

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

the class InlineOptionsDialog method createCenterPanel.

@NotNull
@Override
protected JComponent createCenterPanel() {
    JPanel optionsPanel = new JPanel();
    optionsPanel.setBorder(new EmptyBorder(JBUI.scale(10), 0, 0, 0));
    optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.Y_AXIS));
    myRbInlineAll = new JRadioButton();
    myRbInlineAll.setText(getInlineAllText());
    myRbInlineAll.setSelected(true);
    myRbInlineThisOnly = new JRadioButton();
    myRbInlineThisOnly.setText(getInlineThisText());
    final boolean writable = allowInlineAll();
    optionsPanel.add(myRbInlineAll);
    String keepDeclarationText = getKeepTheDeclarationText();
    if (keepDeclarationText != null && writable) {
        myKeepTheDeclaration = new JRadioButton();
        myKeepTheDeclaration.setText(keepDeclarationText);
        optionsPanel.add(myKeepTheDeclaration);
    }
    optionsPanel.add(myRbInlineThisOnly);
    ButtonGroup bg = new ButtonGroup();
    final JRadioButton[] buttons = myKeepTheDeclaration != null ? new JRadioButton[] { myRbInlineAll, myKeepTheDeclaration, myRbInlineThisOnly } : new JRadioButton[] { myRbInlineAll, myRbInlineThisOnly };
    for (JRadioButton button : buttons) {
        bg.add(button);
    }
    new RadioUpDownListener(buttons);
    myRbInlineThisOnly.setEnabled(myInvokedOnReference);
    myRbInlineAll.setEnabled(writable);
    if (myInvokedOnReference) {
        if (canInlineThisOnly()) {
            myRbInlineAll.setSelected(false);
            myRbInlineAll.setEnabled(false);
            if (myKeepTheDeclaration != null) {
                myKeepTheDeclaration.setSelected(false);
                myKeepTheDeclaration.setEnabled(false);
            }
            myRbInlineThisOnly.setSelected(true);
        } else {
            if (writable) {
                final boolean inlineThis = isInlineThis();
                myRbInlineThisOnly.setSelected(inlineThis);
                if (myKeepTheDeclaration != null)
                    myKeepTheDeclaration.setSelected(false);
                myRbInlineAll.setSelected(!inlineThis);
            } else {
                myRbInlineAll.setSelected(false);
                myRbInlineThisOnly.setSelected(true);
            }
        }
    } else {
        myRbInlineAll.setSelected(true);
        if (myKeepTheDeclaration != null)
            myKeepTheDeclaration.setSelected(false);
        myRbInlineThisOnly.setSelected(false);
    }
    getPreviewAction().setEnabled(myRbInlineAll.isSelected() || myKeepTheDeclaration != null && myKeepTheDeclaration.isSelected());
    final ActionListener previewListener = new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            boolean enabled = myRbInlineAll.isSelected() || myKeepTheDeclaration != null && myKeepTheDeclaration.isSelected();
            getPreviewAction().setEnabled(enabled);
        }
    };
    for (JRadioButton button : buttons) {
        button.addActionListener(previewListener);
    }
    return optionsPanel;
}
Also used : RadioUpDownListener(com.intellij.refactoring.util.RadioUpDownListener) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) EmptyBorder(javax.swing.border.EmptyBorder) NotNull(org.jetbrains.annotations.NotNull)

Example 68 with EmptyBorder

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

the class RunConfigurable method drawPressAddButtonMessage.

private void drawPressAddButtonMessage(final ConfigurationType configurationType) {
    JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
    panel.setBorder(new EmptyBorder(30, 0, 0, 0));
    panel.add(new JLabel("Press the"));
    ActionLink addIcon = new ActionLink("", ADD_ICON, myAddAction);
    addIcon.setBorder(new EmptyBorder(0, 0, 0, 5));
    panel.add(addIcon);
    final String configurationTypeDescription = configurationType != null ? configurationType.getConfigurationTypeDescription() : ExecutionBundle.message("run.configuration.default.type.description");
    panel.add(new JLabel(ExecutionBundle.message("empty.run.configuration.panel.text.label3", configurationTypeDescription)));
    JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(panel, true);
    myRightPanel.removeAll();
    myRightPanel.add(scrollPane, BorderLayout.CENTER);
    if (configurationType == null) {
        JPanel settingsPanel = new JPanel(new GridBagLayout());
        GridBag grid = new GridBag().setDefaultAnchor(GridBagConstraints.NORTHWEST);
        for (Pair<UnnamedConfigurable, JComponent> each : myAdditionalSettings) {
            settingsPanel.add(each.second, grid.nextLine().next());
        }
        settingsPanel.add(createSettingsPanel(), grid.nextLine().next());
        JPanel wrapper = new JPanel(new BorderLayout());
        wrapper.add(settingsPanel, BorderLayout.WEST);
        wrapper.add(Box.createGlue(), BorderLayout.CENTER);
        myRightPanel.add(wrapper, BorderLayout.SOUTH);
    }
    myRightPanel.revalidate();
    myRightPanel.repaint();
}
Also used : EmptyBorder(javax.swing.border.EmptyBorder) ActionLink(com.intellij.ui.components.labels.ActionLink)

Example 69 with EmptyBorder

use of javax.swing.border.EmptyBorder in project jadx by skylot.

the class LineNumbers method setBorderGap.

public void setBorderGap(int borderGap) {
    Border inner = new EmptyBorder(0, borderGap, 0, borderGap);
    setBorder(new CompoundBorder(OUTER, inner));
    lastDigits = 0;
}
Also used : CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) MatteBorder(javax.swing.border.MatteBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 70 with EmptyBorder

use of javax.swing.border.EmptyBorder in project jgnash by ccavanaugh.

the class MainFrame method buildMainView.

private MainViewPanel buildMainView() {
    MainViewPanel panel = new MainViewPanel();
    panel.setBorder(new EmptyBorder(new Insets(2, 6, 0, 2)));
    panel.addActionListener(this);
    return panel;
}
Also used : Insets(java.awt.Insets) EmptyBorder(javax.swing.border.EmptyBorder)

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