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);
}
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;
}
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();
}
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;
}
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;
}
Aggregations