Search in sources :

Example 21 with GridBag

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;
}
Also used : CheckBox(com.intellij.util.ui.CheckBox) GridBag(com.intellij.util.ui.GridBag)

Example 22 with GridBag

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;
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) GridBag(com.intellij.util.ui.GridBag) JBCheckBox(com.intellij.ui.components.JBCheckBox)

Aggregations

GridBag (com.intellij.util.ui.GridBag)22 JBLabel (com.intellij.ui.components.JBLabel)7 JBCheckBox (com.intellij.ui.components.JBCheckBox)4 NotNull (org.jetbrains.annotations.NotNull)3 Nullable (org.jetbrains.annotations.Nullable)3 MultiRowFlowPanel (com.intellij.util.ui.MultiRowFlowPanel)2 GradleEditorEntityGroup (com.android.tools.idea.gradle.editor.entity.GradleEditorEntityGroup)1 DocumentAdapter (com.intellij.openapi.editor.event.DocumentAdapter)1 DocumentEvent (com.intellij.openapi.editor.event.DocumentEvent)1 ExternalSystemUiAware (com.intellij.openapi.externalSystem.ExternalSystemUiAware)1 ExternalProjectPathField (com.intellij.openapi.externalSystem.service.ui.ExternalProjectPathField)1 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)1 Splitter (com.intellij.openapi.ui.Splitter)1 DocumentAdapter (com.intellij.ui.DocumentAdapter)1 EditorTextField (com.intellij.ui.EditorTextField)1 RawCommandLineEditor (com.intellij.ui.RawCommandLineEditor)1 JBPanel (com.intellij.ui.components.JBPanel)1 JBRadioButton (com.intellij.ui.components.JBRadioButton)1 JBTextField (com.intellij.ui.components.JBTextField)1 CheckBox (com.intellij.util.ui.CheckBox)1