use of com.intellij.ui.components.JBCheckBox in project intellij-community by JetBrains.
the class HgUpdateDialog method createCenterPanel.
@NotNull
public JComponent createCenterPanel() {
String panelConstraints = "flowy, ins 0, fill";
MigLayout migLayout = new MigLayout(panelConstraints);
JPanel contentPane = new JPanel(migLayout);
myPullCheckBox = new JBCheckBox("Pull", true);
myPullCheckBox.setMnemonic('p');
myPullCheckBox.setToolTipText("Pull from the default remote repository");
myPullCheckBox.setSelected(true);
myOnlyUpdateButton = new JRadioButton("Only Update", true);
myOnlyUpdateButton.setMnemonic('u');
myOnlyUpdateButton.setToolTipText("Update to the head of the current branch");
myMergeRadioButton = new JRadioButton("Merge", false);
myMergeRadioButton.setMnemonic('m');
myMergeRadioButton.setToolTipText("Merge if pulling resulted in extra heads");
myMergeRadioButton.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
updateEnabledStates();
}
});
myCommitAfterMergeCheckBox = new JCheckBox("Commit after merge without conflicts", false);
myCommitAfterMergeCheckBox.setMnemonic('c');
myCommitAfterMergeCheckBox.setToolTipText("Commit automatically after the merge");
myCommitAfterMergeCheckBox.setSelected(false);
myRebaseRadioButton = new JRadioButton("Rebase", false);
myRebaseRadioButton.setToolTipText("Rebase changesets to a branch tip as destination");
myRebaseRadioButton.setMnemonic('r');
contentPane.add(myPullCheckBox, "left");
JPanel strategyPanel = new JPanel(new MigLayout(panelConstraints));
strategyPanel.setBorder(IdeBorderFactory.createTitledBorder("Update Strategy", false));
strategyPanel.add(myOnlyUpdateButton, "left");
strategyPanel.add(myMergeRadioButton, "left");
strategyPanel.add(myCommitAfterMergeCheckBox, "gapx 5%");
strategyPanel.add(myRebaseRadioButton, "left");
contentPane.add(strategyPanel);
ButtonGroup group = new ButtonGroup();
group.add(myOnlyUpdateButton);
group.add(myRebaseRadioButton);
group.add(myMergeRadioButton);
updateEnabledStates();
return contentPane;
}
use of com.intellij.ui.components.JBCheckBox in project intellij-community by JetBrains.
the class AbstractExternalProjectSettingsControl method fillUi.
@Override
public void fillUi(@NotNull PaintAwarePanel canvas, int indentLevel) {
if (!myCustomizer.isUseAutoImportBoxHidden()) {
myUseAutoImportBox = new JBCheckBox(ExternalSystemBundle.message("settings.label.use.auto.import"));
canvas.add(myUseAutoImportBox, ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
}
if (!myCustomizer.isCreateEmptyContentRootDirectoriesBoxHidden()) {
myCreateEmptyContentRootDirectoriesBox = new JBCheckBox(ExternalSystemBundle.message("settings.label.create.empty.content.root.directories"));
canvas.add(myCreateEmptyContentRootDirectoriesBox, ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
}
fillExtraControls(canvas, indentLevel);
}
use of com.intellij.ui.components.JBCheckBox in project intellij-community by JetBrains.
the class XmlEmmetConfigurable method reset.
@Override
public void reset() {
EmmetOptions emmetOptions = EmmetOptions.getInstance();
myEnableEmmetJBCheckBox.setSelected(emmetOptions.isEmmetEnabled());
myEnablePreviewJBCheckBox.setEnabled(emmetOptions.isEmmetEnabled());
myEnablePreviewJBCheckBox.setSelected(emmetOptions.isPreviewEnabled());
myEnableHrefAutodetectJBCheckBox.setEnabled(emmetOptions.isEmmetEnabled());
myEnableHrefAutodetectJBCheckBox.setSelected(emmetOptions.isHrefAutoDetectEnabled());
myAddEditPointAtTheEndOfTemplateJBCheckBox.setEnabled(emmetOptions.isEmmetEnabled());
myAddEditPointAtTheEndOfTemplateJBCheckBox.setSelected(emmetOptions.isAddEditPointAtTheEndOfTemplate());
myBemElementSeparatorTextField.setText(emmetOptions.getBemElementSeparator());
myBemModifierSeparatorTextField.setText(emmetOptions.getBemModifierSeparator());
myBemShortElementPrefixTextField.setText(emmetOptions.getBemShortElementPrefix());
Set<String> enabledByDefault = emmetOptions.getFiltersEnabledByDefault();
for (ZenCodingFilter filter : ZenCodingFilter.getInstances()) {
final String filterSuffix = filter.getSuffix();
final JBCheckBox checkBox = myFilterCheckboxes.get(filterSuffix);
if (checkBox != null) {
checkBox.setEnabled(emmetOptions.isEmmetEnabled());
checkBox.setSelected(enabledByDefault.contains(filterSuffix));
}
}
}
use of com.intellij.ui.components.JBCheckBox in project intellij-community by JetBrains.
the class AbstractCreateVirtualEnvDialog method setupDialog.
void setupDialog(Project project, final List<Sdk> allSdks) {
myProject = project;
final GridBagLayout layout = new GridBagLayout();
myMainPanel = new JPanel(layout);
myName = new JTextField();
myDestination = new TextFieldWithBrowseButton();
myMakeAvailableToAllProjectsCheckbox = new JBCheckBox(PyBundle.message("sdk.create.venv.dialog.make.available.to.all.projects"));
if (project == null || project.isDefault() || !PlatformUtils.isPyCharm()) {
myMakeAvailableToAllProjectsCheckbox.setSelected(true);
myMakeAvailableToAllProjectsCheckbox.setVisible(false);
}
layoutPanel(allSdks);
init();
setOKActionEnabled(false);
registerValidators(new FacetValidatorsManager() {
public void registerValidator(FacetEditorValidator validator, JComponent... componentsToWatch) {
}
public void validate() {
checkValid();
}
});
myMainPanel.setPreferredSize(new Dimension(300, 50));
checkValid();
setInitialDestination();
addUpdater(myName);
new LocationNameFieldsBinding(project, myDestination, myName, myInitialPath, PyBundle.message("sdk.create.venv.dialog.select.venv.location"));
}
use of com.intellij.ui.components.JBCheckBox in project intellij-plugins by JetBrains.
the class TsLintView method createCenterComponent.
@NotNull
@Override
protected Component createCenterComponent() {
myRules = new TextFieldWithBrowseButton();
myAllowJs = new JBCheckBox();
SwingHelper.installFileCompletionAndBrowseDialog(myProject, myRules, "Select additional rules directory", FileChooserDescriptorFactory.createSingleFolderDescriptor());
final FormBuilder nodeFieldsWrapperBuilder = FormBuilder.createFormBuilder().setAlignLabelOnRight(true).setHorizontalGap(UIUtil.DEFAULT_HGAP).setVerticalGap(UIUtil.DEFAULT_VGAP).setFormLeftIndent(UIUtil.DEFAULT_HGAP).addLabeledComponent("&Node interpreter:", myNodeModuleConfigurationView.getNodeInterpreterField()).addLabeledComponent("TSLint package:", myNodeModuleConfigurationView.getPackageField());
JPanel panel = FormBuilder.createFormBuilder().setAlignLabelOnRight(true).setHorizontalGap(UIUtil.DEFAULT_HGAP).setVerticalGap(UIUtil.DEFAULT_VGAP).setFormLeftIndent(UIUtil.DEFAULT_HGAP).addComponent(nodeFieldsWrapperBuilder.getPanel()).addComponent(myConfigFileView.getComponent()).addSeparator(4).addVerticalGap(4).addLabeledComponent("Additional rules directory:", myRules).addLabeledComponent("Lint JavaScript files:", myAllowJs).getPanel();
final JPanel centerPanel = SwingHelper.wrapWithHorizontalStretch(panel);
centerPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
return centerPanel;
}
Aggregations