Search in sources :

Example 16 with JBCheckBox

use of com.intellij.ui.components.JBCheckBox in project intellij-community by JetBrains.

the class GitUserNameNotDefinedDialog method createCenterPanel.

@Override
protected JComponent createCenterPanel() {
    JLabel icon = new JLabel(UIUtil.getWarningIcon(), SwingConstants.LEFT);
    JLabel description = new JLabel(getMessageText());
    myNameTextField = new JTextField(20);
    JBLabel nameLabel = new JBLabel("Name: ");
    nameLabel.setDisplayedMnemonic('n');
    nameLabel.setLabelFor(myNameTextField);
    myEmailTextField = new JTextField(20);
    JBLabel emailLabel = new JBLabel("E-mail: ");
    emailLabel.setDisplayedMnemonic('e');
    emailLabel.setLabelFor(myEmailTextField);
    if (myProposedValues != null) {
        myNameTextField.setText(myProposedValues.getFirst());
        myEmailTextField.setText(myProposedValues.getSecond());
    } else {
        myNameTextField.setText(SystemProperties.getUserName());
    }
    myGlobalCheckbox = new JBCheckBox("Set properties globally", mySettings.shouldSetUserNameGlobally());
    myGlobalCheckbox.setMnemonic('g');
    JPanel rootPanel = new JPanel(new GridBagLayout());
    GridBag g = new GridBag().setDefaultInsets(new Insets(0, 0, DEFAULT_VGAP, DEFAULT_HGAP)).setDefaultAnchor(GridBagConstraints.LINE_START).setDefaultFill(GridBagConstraints.HORIZONTAL);
    rootPanel.add(description, g.nextLine().next().coverLine(3).pady(DEFAULT_HGAP));
    rootPanel.add(icon, g.nextLine().next().coverColumn(3));
    rootPanel.add(nameLabel, g.next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
    rootPanel.add(myNameTextField, g.next());
    rootPanel.add(emailLabel, g.nextLine().next().next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
    rootPanel.add(myEmailTextField, g.next());
    rootPanel.add(myGlobalCheckbox, g.nextLine().next().next().coverLine(2));
    return rootPanel;
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) GridBag(com.intellij.util.ui.GridBag) JBCheckBox(com.intellij.ui.components.JBCheckBox)

Example 17 with JBCheckBox

use of com.intellij.ui.components.JBCheckBox in project intellij-community by JetBrains.

the class GradleRunnerConfigurable method createUIComponents.

private void createUIComponents() {
    myGradleAwareMakeCheckBox = new JBCheckBox(GradleBundle.message("gradle.settings.text.use.gradle.aware.make"));
    myGradleAwareMakeCheckBox.addActionListener(e -> enableGradleMake(myGradleAwareMakeCheckBox.isSelected()));
    myPreferredTestRunner = new ComboBox<>(getItems());
}
Also used : JBCheckBox(com.intellij.ui.components.JBCheckBox)

Example 18 with JBCheckBox

use of com.intellij.ui.components.JBCheckBox in project intellij-community by JetBrains.

the class IdeaGradleProjectSettingsControlBuilder method createAndFillControls.

@Override
public void createAndFillControls(PaintAwarePanel content, int indentLevel) {
    content.setPaintCallback(graphics -> showBalloonIfNecessary());
    content.addPropertyChangeListener(new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (!"ancestor".equals(evt.getPropertyName())) {
                return;
            }
            // Configure the balloon to show on initial configurable drawing.
            myShowBalloonIfNecessary = evt.getNewValue() != null && evt.getOldValue() == null;
            if (evt.getNewValue() == null && evt.getOldValue() != null) {
                // Cancel delayed balloons when the configurable is hidden.
                myAlarm.cancelAllRequests();
            }
        }
    });
    if (!dropResolveModulePerSourceSetCheckBox) {
        myResolveModulePerSourceSetCheckBox = new JBCheckBox(GradleBundle.message("gradle.settings.text.create.module.per.sourceset"));
        content.add(myResolveModulePerSourceSetCheckBox, ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
    }
    addGradleChooserComponents(content, indentLevel);
    addGradleHomeComponents(content, indentLevel);
    addGradleJdkComponents(content, indentLevel);
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener) JBCheckBox(com.intellij.ui.components.JBCheckBox)

Example 19 with JBCheckBox

use of com.intellij.ui.components.JBCheckBox in project intellij-community by JetBrains.

the class EditorConfigConfigurable method createComponent.

@Nullable
@Override
public JComponent createComponent() {
    myEnabled = new JBCheckBox("Enable EditorConfig support");
    final JPanel result = new JPanel();
    result.setLayout(new BoxLayout(result, BoxLayout.LINE_AXIS));
    final JPanel panel = new JPanel(new VerticalFlowLayout());
    result.setBorder(IdeBorderFactory.createTitledBorder("EditorConfig", false));
    panel.add(myEnabled);
    final JLabel warning = new JLabel("EditorConfig may override the IDE code style settings");
    warning.setFont(UIUtil.getLabelFont(UIUtil.FontSize.SMALL));
    warning.setBorder(IdeBorderFactory.createEmptyBorder(0, 20, 0, 0));
    panel.add(warning);
    panel.setAlignmentY(Component.TOP_ALIGNMENT);
    result.add(panel);
    final JButton export = new JButton("Export");
    export.addActionListener((event) -> {
        final Component parent = UIUtil.findUltimateParent(result);
        if (parent instanceof IdeFrame) {
            Utils.export(((IdeFrame) parent).getProject());
        }
    });
    export.setAlignmentY(Component.TOP_ALIGNMENT);
    result.add(export);
    return result;
}
Also used : IdeFrame(com.intellij.openapi.wm.IdeFrame) JBCheckBox(com.intellij.ui.components.JBCheckBox) VerticalFlowLayout(com.intellij.openapi.ui.VerticalFlowLayout) Nullable(org.jetbrains.annotations.Nullable)

Example 20 with JBCheckBox

use of com.intellij.ui.components.JBCheckBox 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

JBCheckBox (com.intellij.ui.components.JBCheckBox)28 JBLabel (com.intellij.ui.components.JBLabel)10 Nullable (org.jetbrains.annotations.Nullable)5 ComboBox (com.intellij.openapi.ui.ComboBox)4 JBTextField (com.intellij.ui.components.JBTextField)4 GridBag (com.intellij.util.ui.GridBag)4 NotNull (org.jetbrains.annotations.NotNull)4 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)3 ActionEvent (java.awt.event.ActionEvent)3 ProjectSelector (com.google.cloud.tools.intellij.project.ProjectSelector)2 ZenCodingFilter (com.intellij.codeInsight.template.emmet.filters.ZenCodingFilter)2 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)2 ActionListener (java.awt.event.ActionListener)2 ItemEvent (java.awt.event.ItemEvent)2 ItemListener (java.awt.event.ItemListener)2 PhoneGapTargets (com.github.masahirosuzuka.PhoneGapIntelliJPlugin.commandLine.PhoneGapTargets)1 Option (com.intellij.codeInsight.hints.Option)1 EnvironmentVariablesTextFieldWithBrowseButton (com.intellij.execution.configuration.EnvironmentVariablesTextFieldWithBrowseButton)1 FacetEditorValidator (com.intellij.facet.ui.FacetEditorValidator)1 FacetValidatorsManager (com.intellij.facet.ui.FacetValidatorsManager)1