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