use of com.intellij.util.ui.GridBag in project intellij-community by JetBrains.
the class ConstructorCountInspection method createOptionsPanel.
@Override
public JComponent createOptionsPanel() {
final JLabel label = new JLabel(getConfigurationLabel());
final JFormattedTextField valueField = prepareNumberEditor("m_limit");
final CheckBox includeCheckBox = new CheckBox(InspectionGadgetsBundle.message("too.many.constructors.ignore.deprecated.option"), this, "ignoreDeprecatedConstructors");
final GridBag bag = new GridBag();
bag.setDefaultInsets(0, 0, 0, UIUtil.DEFAULT_HGAP);
bag.setDefaultAnchor(GridBagConstraints.WEST);
final JPanel panel = new JPanel(new GridBagLayout());
panel.add(label, bag.nextLine().next());
panel.add(valueField, bag.next().weightx(1.0));
panel.add(includeCheckBox, bag.nextLine().next().coverLine().weighty(1.0).anchor(GridBagConstraints.NORTHWEST));
return panel;
}
use of com.intellij.util.ui.GridBag in project intellij-community by JetBrains.
the class GitCrlfDialog method createCenterPanel.
@Override
protected JComponent createCenterPanel() {
JLabel description = new JBLabel("<html>You are about to commit CRLF line separators to the Git repository.<br/>" + "It is recommended to set core.autocrlf Git attribute to <code>" + RECOMMENDED_VALUE + "</code> to avoid line separator issues.</html>");
JLabel additionalDescription = new JBLabel("<html>Fix and Commit: <code>git config --global core.autocrlf " + RECOMMENDED_VALUE + "</code> will be called,<br/>" + "Commit as Is: the config value won't be set.</html>", UIUtil.ComponentStyle.SMALL);
JLabel readMore = LinkLabel.create("Read more", () -> BrowserUtil.browse("https://help.github.com/articles/dealing-with-line-endings"));
JLabel icon = new JLabel(UIUtil.getWarningIcon(), SwingConstants.LEFT);
myDontWarn = new JBCheckBox("Don't warn again");
myDontWarn.setMnemonic('w');
JPanel rootPanel = new JPanel(new GridBagLayout());
GridBag g = new GridBag().setDefaultInsets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)).setDefaultAnchor(GridBagConstraints.LINE_START).setDefaultFill(GridBagConstraints.HORIZONTAL);
rootPanel.add(icon, g.nextLine().next().coverColumn(4));
rootPanel.add(description, g.next());
rootPanel.add(readMore, g.nextLine().next().next());
rootPanel.add(additionalDescription, g.nextLine().next().next().pady(DEFAULT_HGAP));
rootPanel.add(myDontWarn, g.nextLine().next().next().insets(0, 0, 0, 0));
return rootPanel;
}
Aggregations