Search in sources :

Example 21 with JBCheckBox

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;
}
Also used : ItemEvent(java.awt.event.ItemEvent) MigLayout(net.miginfocom.swing.MigLayout) ItemListener(java.awt.event.ItemListener) JBCheckBox(com.intellij.ui.components.JBCheckBox) NotNull(org.jetbrains.annotations.NotNull)

Example 22 with JBCheckBox

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

Example 23 with JBCheckBox

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));
        }
    }
}
Also used : ZenCodingFilter(com.intellij.codeInsight.template.emmet.filters.ZenCodingFilter) JBCheckBox(com.intellij.ui.components.JBCheckBox)

Example 24 with JBCheckBox

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"));
}
Also used : TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) FacetValidatorsManager(com.intellij.facet.ui.FacetValidatorsManager) LocationNameFieldsBinding(com.intellij.platform.LocationNameFieldsBinding) FacetEditorValidator(com.intellij.facet.ui.FacetEditorValidator) JBCheckBox(com.intellij.ui.components.JBCheckBox)

Example 25 with JBCheckBox

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;
}
Also used : FormBuilder(com.intellij.util.ui.FormBuilder) TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) JBCheckBox(com.intellij.ui.components.JBCheckBox) NotNull(org.jetbrains.annotations.NotNull)

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