Java 类com.intellij.ui.components.JBCheckBox 实例源码

项目:intellij-nette-tester    文件:TesterTestEnvironmentSettingsEditor.java   
private void createUIComponents() {
    phpInterpreter = new PhpInterpreterComboBox(project, null);
    phpInterpreter.setModel(PhpInterpretersManagerImpl.getInstance(project).getInterpreters(), null);
    phpInterpreter.setNoItemText("<default project interpreter>");

    interpreterOptions = new PhpConfigurationOptionsComponent();

    phpIniPath = new TextFieldWithBrowseButton();
    phpIniPath.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileDescriptor("ini"));

    useSystemPhpIniCheckbox = new JBCheckBox(TesterBundle.message("runConfiguration.editor.testEnv.useSystemPhpIni"));

    interpreterLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.testEnv.interpreter"));
    interpreterOptionsLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.testEnv.interpreterOptions"));
    pathToPhpIniLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.testEnv.phpIni"));
}
项目:PackageTemplates    文件:SelectFileTemplateDialog.java   
@NotNull
private JPanel getOptionsPanel(final JPanel root) {
    JPanel options = new JPanel(new GridBagLayout());
    GridBag bag = new GridBag()
            .setDefaultInsets(new JBInsets(0, 4, 0, 4))
            .setDefaultFill(GridBagConstraints.HORIZONTAL);

    cbAddInternal = new JBCheckBox("Internal");
    cbAddJ2EE = new JBCheckBox("J2EE");

    ItemListener itemListener = e -> {
        root.remove(comboBox);
        comboBox = getSelector();
        root.add(comboBox);
        root.revalidate();
    };

    cbAddInternal.addItemListener(itemListener);
    cbAddJ2EE.addItemListener(itemListener);

    options.add(cbAddInternal, bag.nextLine().next());
    options.add(cbAddJ2EE, bag.next());
    return options;
}
项目:intellij-ce-playground    文件:ProjectStartupConfigurable.java   
private void installRenderers() {
  final TableColumn checkboxColumn = myTable.getColumnModel().getColumn(ProjectStartupTasksTableModel.IS_SHARED_COLUMN);
  final String header = checkboxColumn.getHeaderValue().toString();
  final FontMetrics fm = myTable.getFontMetrics(myTable.getTableHeader().getFont());
  final int width = - new JBCheckBox().getPreferredSize().width + fm.stringWidth(header + "ww");
  TableUtil.setupCheckboxColumn(checkboxColumn, width);
  checkboxColumn.setCellRenderer(new BooleanTableCellRenderer());

  myTable.getTableHeader().setResizingAllowed(false);
  myTable.getTableHeader().setReorderingAllowed(false);

  final TableColumn nameColumn = myTable.getColumnModel().getColumn(ProjectStartupTasksTableModel.NAME_COLUMN);
  nameColumn.setCellRenderer(new ColoredTableCellRenderer() {
    @Override
    protected void customizeCellRenderer(JTable table, @Nullable Object value, boolean selected, boolean hasFocus, int row, int column) {
      final RunnerAndConfigurationSettings settings = myModel.getAllConfigurations().get(row);
      setIcon(settings.getConfiguration().getIcon());
      append(settings.getName());
    }
  });
}
项目:intellij-ce-playground    文件:XmlEmmetConfigurable.java   
public XmlEmmetConfigurable() {
  myEnableEmmetJBCheckBox.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      boolean selected = myEnableEmmetJBCheckBox.isSelected();
      myEnablePreviewJBCheckBox.setEnabled(selected);
      myFiltersListPanel.setEnabled(selected);
      myEnableHrefAutodetectJBCheckBox.setEnabled(selected);
      for (JBCheckBox checkBox : myFilterCheckboxes.values()) {
        checkBox.setEnabled(selected);
      }
    }
  });
  myFiltersListPanel.setBorder(IdeBorderFactory.createTitledBorder(XmlBundle.message("emmet.filters.enabled.by.default")));
  createFiltersCheckboxes();
}
项目:intellij-ce-playground    文件:XmlEmmetConfigurable.java   
@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.setSelected(emmetOptions.isAddEditPointAtTheEndOfTemplate());

  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));
    }
  }
}
项目:intellij-ce-playground    文件:TrelloRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myBoardComboBox = new ComboBox(300);
  myBoardLabel = new JBLabel("Board:", SwingConstants.RIGHT);
  myBoardLabel.setLabelFor(myBoardComboBox);

  myListComboBox = new ComboBox(300);
  myListLabel = new JBLabel("List:", SwingConstants.RIGHT);
  myListLabel.setLabelFor(myListComboBox);

  myAllCardsCheckBox = new JBCheckBox("Include cards not assigned to me");

  return FormBuilder.createFormBuilder()
    .addLabeledComponent(myBoardLabel, myBoardComboBox)
    .addLabeledComponent(myListLabel, myListComboBox)
    .addComponentToRightColumn(myAllCardsCheckBox)
    .getPanel();
}
项目:intellij    文件:BlazeIntellijPluginConfiguration.java   
public BlazeIntellijPluginConfigurationSettingsEditor(
    Iterable<Label> javaLabels,
    RunConfigurationStateEditor blazeFlagsEditor,
    RunConfigurationStateEditor exeFlagsEditor) {
  targetCombo =
      new ComboBox<>(
          new DefaultComboBoxModel<>(
              Ordering.usingToString().sortedCopy(javaLabels).toArray(new Label[0])));
  targetCombo.setRenderer(
      new ListCellRendererWrapper<Label>() {
        @Override
        public void customize(
            JList list, @Nullable Label value, int index, boolean selected, boolean hasFocus) {
          setText(value == null ? null : value.toString());
        }
      });
  this.blazeFlagsEditor = blazeFlagsEditor;
  this.exeFlagsEditor = exeFlagsEditor;
  ProjectSdksModel sdksModel = new ProjectSdksModel();
  sdksModel.reset(null);
  sdkCombo = new JdkComboBox(sdksModel, IdeaJdkHelper::isIdeaJdkType);

  keepInSyncCheckBox = new JBCheckBox("Keep in sync with source XML");
  keepInSyncCheckBox.addItemListener(e -> updateEnabledStatus());
}
项目:wuff-intellij-plugin    文件:WuffRunConfigurationEditor.java   
@Override
protected void applyEditorTo(WuffRunConfiguration wuffRunConfiguration) throws ConfigurationException {
    PersistentConfigurationValues configurationValues = wuffRunConfiguration.getConfigurationValues();

    Module selectedModule = myModules.getSelectedModule();
    String selectedModuleName = selectedModule == null ? null : selectedModule.getName();

    configurationValues.setModuleName(selectedModuleName);
    configurationValues.setMainClass(myEquinoxMainClass.getText());
    configurationValues.setVmArgs(myVMParameters.getComponent().getText());
    configurationValues.setApplicationName(myApplicationName.getText());
    java.util.List<EquinoxConfigurationOptions> enabledConfigsFromEditor = new ArrayList<>();

    for (JBCheckBox cb : launchConfigOptions) {
        if (cb.isSelected()) {
            enabledConfigsFromEditor.add(optionMapping.get(cb));
        }
    }
    configurationValues.replaceAllEnableConfigs(enabledConfigsFromEditor);

    configurationValues.setAutoDiagnostic(myAutomaticDiagnostic.isSelected());
    configurationValues.setDiagnosticUrl(myUrl.getText());
    configurationValues.setDiagnosticUsername(myUser.getText());
    configurationValues.setDiagnosticPassword(myPassword.getText());

}
项目:wuff-intellij-plugin    文件:WuffRunConfigurationEditor.java   
private void setCurrentValuesToControls() {
    myModules.fillModules(config.getProject(), JavaModuleType.getModuleType());
    myVMParameters.getComponent().setText(configurationValues.getVmArgs());
    myModules.setSelectedModule(config.getModule());
    myEquinoxMainClass.setText(configurationValues.getMainClass());
    myApplicationName.setText(configurationValues.getApplicationName());
    for (JBCheckBox jb : launchConfigOptions) {
        if (configurationValues.getEnabledConfigs().contains(optionMapping.get(jb))) {
            jb.setSelected(true);
        }
    }

    myAutomaticDiagnostic.setSelected(configurationValues.isAutoDiagnostic());
    myUrl.setText(configurationValues.getDiagnosticUrl());
    myUser.setText(configurationValues.getDiagnosticUsername());
    myPassword.setText(configurationValues.getDiagnosticPassword());
}
项目:tools-idea    文件:HgBookmarkDialog.java   
@Override
@NotNull
protected JComponent createCenterPanel() {

  JPanel contentPanel = new JPanel(new GridBagLayout());
  GridBag g = new GridBag()
    .setDefaultInsets(new Insets(0, 0, DEFAULT_VGAP, DEFAULT_HGAP))
    .setDefaultAnchor(GridBagConstraints.LINE_START)
    .setDefaultFill(GridBagConstraints.HORIZONTAL);

  JLabel icon = new JLabel(UIUtil.getQuestionIcon(), SwingConstants.LEFT);
  myBookmarkName = new JBTextField(13);

  JBLabel bookmarkLabel = new JBLabel("Bookmark name:");
  bookmarkLabel.setLabelFor(myBookmarkName);

  myActiveCheckbox = new JBCheckBox("Inactive", false);

  contentPanel.add(icon, g.nextLine().next().coverColumn(3).pady(DEFAULT_HGAP));
  contentPanel.add(bookmarkLabel, g.next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
  contentPanel.add(myBookmarkName, g.next().coverLine().setDefaultWeightX(1));
  contentPanel.add(myActiveCheckbox, g.nextLine().next().next().coverLine(2));
  return contentPanel;
}
项目:targetprocess-intellij-plugin    文件:TargetProcessRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
    myUseNTLM = new JBCheckBox("Use NTLM Authentication");
    installListener(myUseNTLM);

    myHostLabel = new JBLabel("Host:", SwingConstants.RIGHT);
    myHost = new JTextField();
    myHost.setEnabled(false);
    installListener(myHost);

    myDomainLabel = new JBLabel("Domain:", SwingConstants.RIGHT);
    myDomain = new JTextField();
    myDomain.setEnabled(false);
    installListener(myDomain);

    return FormBuilder.createFormBuilder().addComponentToRightColumn(myUseNTLM, UIUtil.LARGE_VGAP).addLabeledComponent(myHostLabel, myHost)
            .addLabeledComponent(myDomainLabel, myDomain).getPanel();
}
项目:consulo    文件:ParameterNameHintsConfigurable.java   
private void createUIComponents() {
  List<Language> languages = getBaseLanguagesWithProviders();

  Language selected = myInitiallySelectedLanguage;
  if (selected == null) {
    selected = languages.get(0);
  }

  String text = getLanguageBlackList(selected);
  myEditorTextField = createEditor(text, myNewPreselectedItem);
  myEditorTextField.addDocumentListener(new DocumentAdapter() {
    @Override
    public void documentChanged(DocumentEvent e) {
      updateOkEnabled();
    }
  });

  myDoNotShowIfParameterNameContainedInMethodName = new JBCheckBox();
  myShowWhenMultipleParamsWithSameType = new JBCheckBox();

  ParameterNameHintsSettings settings = ParameterNameHintsSettings.getInstance();
  myDoNotShowIfParameterNameContainedInMethodName.setSelected(settings.isDoNotShowIfMethodNameContainsParameterName());
  myShowWhenMultipleParamsWithSameType.setSelected(settings.isShowForParamsWithSameType());

  initLanguageCombo(languages, selected);
}
项目:android-parcelable-intellij-plugin    文件:GenerateDialog.java   
protected GenerateDialog(final PsiClass psiClass) {
    super(psiClass.getProject());
    setTitle("Select Fields for Parcelable Generation");

    fieldsCollection = new CollectionListModel<PsiField>();
    final JBList fieldList = new JBList(fieldsCollection);
    fieldList.setCellRenderer(new DefaultPsiElementCellRenderer());
    final ToolbarDecorator decorator = ToolbarDecorator.createDecorator(fieldList).disableAddAction();
    final JPanel panel = decorator.createPanel();

    fieldsComponent = LabeledComponent.create(panel, "Fields to include in Parcelable");

    includeSubclasses = new JBCheckBox("Include fields from base classes");
    setupCheckboxClickAction(psiClass);
    showCheckbox = psiClass.getFields().length != psiClass.getAllFields().length;

    updateFieldsDisplay(psiClass);
    init();
}
项目:PackageTemplates    文件:DirectoryWrapper.java   
@NotNull
private JPanel getOptionsPanel() {
    //  isEnabled
    cbEnabled = new JBCheckBox();
    cbEnabled.setSelected(directory.isEnabled());
    cbEnabled.addItemListener(e -> setEnabled(cbEnabled.isSelected()));
    cbEnabled.setToolTipText(Localizer.get("tooltip.IfCheckedElementWillBeCreated"));

    // Script
    jlScript = new IconLabel(
            Localizer.get("tooltip.ColoredWhenItemHasScript"),
            PluginIcons.SCRIPT,
            PluginIcons.SCRIPT_DISABLED
    );

    // CustomPath
    jlCustomPath = new IconLabel(
            Localizer.get("tooltip.ColoredWhenItemHasCustomPath"),
            PluginIcons.CUSTOM_PATH,
            PluginIcons.CUSTOM_PATH_DISABLED
    );

    // WriteRules
    jlWriteRules = new IconLabelCustom<Directory>(Localizer.get("tooltip.WriteRules"), directory) {
        @Override
        public void onUpdateIcon(Directory item) {
            setIcon(item.getWriteRules().toIcon());
        }
    };

    updateOptionIcons();

    JPanel optionsPanel = new JPanel(new MigLayout(new LC().insets("0").gridGap("2pt","0")));
    optionsPanel.add(cbEnabled, new CC());
    optionsPanel.add(jlScript, new CC());
    optionsPanel.add(jlCustomPath, new CC());
    optionsPanel.add(jlWriteRules, new CC());
    return optionsPanel;
}
项目:PackageTemplates    文件:FileWrapper.java   
@NotNull
private JPanel getOptionsPanel() {
    JPanel optionsPanel = new JPanel(new MigLayout(new LC().insets("0").gridGap("2pt","0")));

    cbEnabled = new JBCheckBox();
    cbEnabled.setSelected(file.isEnabled());
    cbEnabled.addItemListener(e -> setEnabled(cbEnabled.isSelected()));
    cbEnabled.setToolTipText(Localizer.get("tooltip.IfCheckedElementWillBeCreated"));

    // Script
    jlScript = new IconLabel(
            Localizer.get("tooltip.ColoredWhenItemHasScript"),
            PluginIcons.SCRIPT,
            PluginIcons.SCRIPT_DISABLED
    );

    // CustomPath
    jlCustomPath = new IconLabel(
            Localizer.get("tooltip.ColoredWhenItemHasCustomPath"),
            PluginIcons.CUSTOM_PATH,
            PluginIcons.CUSTOM_PATH_DISABLED
    );

    // WriteRules
    jlWriteRules = new IconLabelCustom<File>(Localizer.get("tooltip.WriteRules"), file) {
        @Override
        public void onUpdateIcon(File item) {
            setIcon(item.getWriteRules().toIcon());
        }
    };

    updateOptionIcons();

    optionsPanel.add(cbEnabled, new CC());
    optionsPanel.add(jlScript, new CC());
    optionsPanel.add(jlCustomPath, new CC());
    optionsPanel.add(jlWriteRules, new CC());
    return optionsPanel;
}
项目:GitLink    文件:Settings.java   
public Settings(Preferences preferences, List<UrlModifier> urlModifiers, Plugin plugin)
{
    this.preferences = preferences;

    $$$setupUI$$$();
    this.hostSelect.setModel(new EnumComboBoxModel<>(RemoteHost.class));
    this.defaultBranchTextField.setText(this.preferences.getDefaultBranch().toString());
    this.customURLPanel.setVisible(this.preferences.getRemoteHost().custom());

    this.applyLabelHelpTextStlye(this.customFileUrlLabel);
    this.applyLabelHelpTextStlye(this.customCommitUrlLabel);
    this.applyLabelHeadingStlye(this.projectSettingsLabel);
    this.applyLabelHeadingStlye(this.customUrlLabel);

    this.hostSelect.addActionListener(e -> {
        RemoteHost host = (((RemoteHost) hostSelect.getSelectedItem()));
        Settings.this.customURLPanel.setVisible((host != null && host.custom()));
    });

    for (UrlModifier modifier : urlModifiers) {
        JBCheckBox checkBox = new JBCheckBox(modifier.name());
        this.urlModifierCheckBoxes.put(modifier, checkBox);
        this.urlModifierCheckBoxPanel.add(checkBox, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    }

    this.pluginDetailsLabel.setText(plugin.toString());
    this.featureRequestLabel.setText(String.format("Submit feature requests and bug reports to %s", plugin.issueTracker()));
    this.applyLabelHelpTextStlye(this.pluginDetailsLabel);
    this.applyLabelHelpTextStlye(this.featureRequestLabel);

}
项目:GitLink    文件:Settings.java   
public boolean isModified()
{
    for (Map.Entry<UrlModifier, JBCheckBox> entry : this.urlModifierCheckBoxes.entrySet()) {
        if (entry.getValue().isSelected() != this.preferences.isModifierEnabled(entry.getKey())) {
            return true;
        }
    }

    return
        this.verboseLoggingCheckBox.isSelected() != this.preferences.getEnableVerboseEventLog() ||
        this.hostSelect.getSelectedItem() != this.preferences.getRemoteHost() ||
        !this.preferences.getDefaultBranch().equals(new Branch(this.defaultBranchTextField.getText())) ||
        !this.preferences.getCustomFileUrlTemplate().equals(this.customFileUrlTemplateTextField.getText()) ||
        !this.preferences.getCustomCommitUrlTemplate().equals(this.customCommitUrlTemplateTextField.getText());
}
项目:GitLink    文件:Settings.java   
public void reset()
{
    this.defaultBranchTextField.setText(this.preferences.getDefaultBranch().toString());
    this.verboseLoggingCheckBox.setSelected(this.preferences.getEnableVerboseEventLog());
    this.hostSelect.setSelectedItem(this.preferences.getRemoteHost());
    this.customFileUrlTemplateTextField.setText(this.preferences.getCustomFileUrlTemplate());
    this.customCommitUrlTemplateTextField.setText(this.preferences.getCustomCommitUrlTemplate());

    for (Map.Entry<UrlModifier, JBCheckBox> entry : this.urlModifierCheckBoxes.entrySet()) {
        entry.getValue().setSelected(this.preferences.isModifierEnabled(entry.getKey()));
    }
}
项目:camel-idea-plugin    文件:CamelEditorSettingsPageTest.java   
public void testShouldChangeStateOfRealTimeEndpointValidationCatalogCheckBox() throws ConfigurationException {
    JBCheckBox checkBox = editorSettingsPage.getRealTimeEndpointValidationCatalogCheckBox();
    assertEquals(true, checkBox.isSelected());
    assertEquals(true, editorSettingsPage.getCamelPreferenceService().isRealTimeEndpointValidation());
    checkBox.setSelected(false);
    editorSettingsPage.apply();
    assertEquals(false, checkBox.isSelected());
    assertEquals(false, editorSettingsPage.getCamelPreferenceService().isRealTimeEndpointValidation());
}
项目:camel-idea-plugin    文件:CamelEditorSettingsPageTest.java   
public void testShouldChangeStateOfRealTimeSimpleValidationCatalogCheckBox() throws ConfigurationException {
    JBCheckBox checkBox = editorSettingsPage.getRealTimeSimpleValidationCatalogCheckBox();
    assertEquals(true, checkBox.isSelected());
    assertEquals(true, editorSettingsPage.getCamelPreferenceService().isRealTimeSimpleValidation());
    checkBox.setSelected(false);
    editorSettingsPage.apply();
    assertEquals(false, checkBox.isSelected());
    assertEquals(false, editorSettingsPage.getCamelPreferenceService().isRealTimeSimpleValidation());
}
项目:camel-idea-plugin    文件:CamelEditorSettingsPageTest.java   
public void testShouldChangeStateOfHighlightCustomOptionsCheckBox() throws ConfigurationException {
    JBCheckBox checkBox = editorSettingsPage.getHighlightCustomOptionsCheckBox();
    assertEquals(true, checkBox.isSelected());
    assertEquals(true, editorSettingsPage.getCamelPreferenceService().isHighlightCustomOptions());
    checkBox.setSelected(false);
    editorSettingsPage.apply();
    assertEquals(false, checkBox.isSelected());
    assertEquals(false, editorSettingsPage.getCamelPreferenceService().isHighlightCustomOptions());
}
项目:camel-idea-plugin    文件:CamelEditorSettingsPageTest.java   
public void testShouldRestRealTimeSimpleValidationCatalogCheckBox() {
    JBCheckBox checkBox = editorSettingsPage.getRealTimeSimpleValidationCatalogCheckBox();
    boolean status = checkBox.isSelected();
    checkBox.setSelected(!status);
    editorSettingsPage.reset();
    assertEquals(status, checkBox.isSelected());
}
项目:camel-idea-plugin    文件:CamelEditorSettingsPageTest.java   
public void testShouldResetHighlightCustomOptionsCheckBox() {
    JBCheckBox checkBox = editorSettingsPage.getHighlightCustomOptionsCheckBox();
    boolean status = checkBox.isSelected();
    checkBox.setSelected(!status);
    editorSettingsPage.reset();
    assertEquals(status, checkBox.isSelected());
}
项目:intellij-ce-playground    文件:AbstractExternalProjectSettingsControl.java   
@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); 
}
项目:intellij-ce-playground    文件:AbstractCreateVirtualEnvDialog.java   
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"));
}
项目:intellij-ce-playground    文件:XmlEmmetConfigurable.java   
public void createFiltersCheckboxes() {
  final List<ZenCodingFilter> filters = ZenCodingFilter.getInstances();
  final GridBagLayout layoutManager = new GridBagLayout();
  final GridBagConstraints constraints = new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, 
                                                                new Insets(0, 0, 0, 0), 0, 0);
  myFiltersListPanel.setLayout(layoutManager);
  for (int i = 0; i < filters.size(); i++) {
    ZenCodingFilter filter = filters.get(i);
    final JBCheckBox checkBox = new JBCheckBox(filter.getDisplayName());
    myFilterCheckboxes.put(filter.getSuffix(), checkBox);
    constraints.gridy = i;
    myFiltersListPanel.add(checkBox, constraints);
  }
  myFiltersListPanel.revalidate();
}
项目:intellij-ce-playground    文件:XmlEmmetConfigurable.java   
@NotNull
private Set<String> enabledFilters() {
  Set<String> result = ContainerUtil.newHashSet();
  for (Map.Entry<String, JBCheckBox> checkbox : myFilterCheckboxes.entrySet()) {
    if (checkbox.getValue().isSelected()) {
      result.add(checkbox.getKey());
    }
  }
  return result;
}
项目:intellij-ce-playground    文件:AndroidXmlCodeStylePanel.java   
AndroidXmlCodeStylePanel(CodeStyleSettings currentSettings, CodeStyleSettings settings) {
  super(XMLLanguage.INSTANCE, currentSettings, settings);
  myPanel = new JPanel(new BorderLayout());
  myPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
  JPanel centerPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false));
  myPanel.add(centerPanel, BorderLayout.CENTER);
  myUseCustomSettings = new JBCheckBox("Use custom formatting settings for Android XML files");
  myPanel.add(myUseCustomSettings, BorderLayout.NORTH);

  myCodeStylePanels = new ArrayList<MyFileSpecificPanel>();

  myCodeStylePanels.add(new ManifestCodeStylePanel());
  myCodeStylePanels.add(new LayoutCodeStylePanel());
  myCodeStylePanels.add(new ValueResourcesCodeStylePanel());
  myCodeStylePanels.add(new OtherCodeStylePanel());

  myFileSpecificCodeStylesPanel = new JPanel(new GridLayout((myCodeStylePanels.size() + 1) / 2, 2, 15, 0));
  centerPanel.add(myFileSpecificCodeStylesPanel);

  myUseCustomSettings.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      UIUtil.setEnabled(myFileSpecificCodeStylesPanel, myUseCustomSettings.isSelected(), true);
    }
  });

  for (MyFileSpecificPanel panel : myCodeStylePanels) {
    final JPanel titledPanel = new JPanel(new BorderLayout());
    titledPanel.setBorder(IdeBorderFactory.createTitledBorder(panel.getTitle()));
    titledPanel.add(panel, BorderLayout.CENTER);
    myFileSpecificCodeStylesPanel.add(titledPanel);
  }
}
项目:intellij-ce-playground    文件:AndroidXmlCodeStylePanel.java   
public ManifestCodeStylePanel() {
  super("AndroidManifest.xml", ContextSpecificSettingsProviders.MANIFEST);

  myPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false));
  myGroupTagsCheckBox = new JBCheckBox("Group tags with the same name");
  myPanel.add(myGroupTagsCheckBox);

  init();
}
项目:intellij-ce-playground    文件:AndroidXmlCodeStylePanel.java   
public ValueResourcesCodeStylePanel() {
  super("Value Resource Files and Selectors", ContextSpecificSettingsProviders.VALUE_RESOURCE_FILE);
  myPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false));
  myInsertLineBreaksAroundStyleCheckBox = new JBCheckBox("Insert line breaks around style declaration");
  myPanel.add(myInsertLineBreaksAroundStyleCheckBox);

  init();
  myInsertLineBreakBeforeFirstAttributeCheckBox.setVisible(false);
  myInsertLineBreakAfterLastAttributeCheckbox.setVisible(false);
}
项目:intellij-ce-playground    文件:IdeaGradleSystemSettingsControlBuilder.java   
@Override
public void fillUi(@NotNull PaintAwarePanel canvas, int indentLevel) {
  if (!dropOfflineModeBox) {
    myOfflineModeBox = new JBCheckBox(GradleBundle.message("gradle.settings.text.offline_work"));
    canvas.add(myOfflineModeBox, ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
  }
  addServiceDirectoryControl(canvas, indentLevel);

  if (!dropVmOptions) {
    myGradleVmOptionsLabel = new JBLabel(GradleBundle.message("gradle.settings.text.vm.options"));
    canvas.add(myGradleVmOptionsLabel, ExternalSystemUiUtil.getLabelConstraints(indentLevel));
    myGradleVmOptionsField = new JBTextField();
    canvas.add(myGradleVmOptionsField, ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
  }
}
项目:intellij-ce-playground    文件:RedmineRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myProjectLabel = new JBLabel("Project:", SwingConstants.RIGHT);
  myProjectCombo = new ComboBox(300);
  //myProjectCombo.setRenderer(new TaskUiUtil.SimpleComboBoxRenderer("Set URL and password/token first"));
  myProjectCombo.setRenderer(new ListCellRendererWrapper<RedmineProjectItem>() {
    @Override
    public void customize(JList list, RedmineProjectItem value, int index, boolean selected, boolean hasFocus) {
      if (value == null) {
        setText("Set URL and password/token first");
      }
      else {
        if (myProjectCombo.isPopupVisible()) {
          //if (value.myLevel == 0 && value.myProject != RedmineRepository.UNSPECIFIED_PROJECT) {
            //setFont(UIUtil.getListFont().deriveFont(Font.BOLD));
          //}
          setText(StringUtil.repeat("   ", value.myLevel) + value.myProject.getName());
        }
        else {
          // Do not indent selected project
          setText(value.myProject.getName());
        }
      }
    }
  });

  myAPIKeyLabel = new JBLabel("API Token:", SwingConstants.RIGHT);
  myAPIKey = new JPasswordField();

  myAllAssigneesCheckBox = new JBCheckBox("Include issues not assigned to me");
  return FormBuilder.createFormBuilder()
    .addLabeledComponent(myAPIKeyLabel, myAPIKey)
    .addLabeledComponent(myProjectLabel, myProjectCombo)
    .addComponentToRightColumn(myAllAssigneesCheckBox)
    .getPanel();
}
项目:intellij-ce-playground    文件:EditorConfigConfigurable.java   
@Nullable
@Override
public JComponent createComponent() {
  myEnabled = new JBCheckBox("Enable EditorConfig support");
  final JPanel panel = new JPanel(new VerticalFlowLayout());
  panel.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);
  return panel;
}
项目:intellij-ce-playground    文件:GitPushTagPanel.java   
public GitPushTagPanel(@Nullable GitPushTagMode defaultMode, boolean followTagsSupported) {
  String checkboxText = "Push Tags";
  if (followTagsSupported) {
    checkboxText += ": ";
  }
  myCheckBox = new JBCheckBox(checkboxText);
  myCheckBox.setMnemonic('T');
  myCheckBox.setSelected(defaultMode != null);

  setLayout(new BorderLayout());
  add(myCheckBox, BorderLayout.WEST);

  if (followTagsSupported) {
    myCombobox = new ComboBox(GitPushTagMode.getValues());
    myCombobox.setRenderer(new ListCellRendererWrapper<GitPushTagMode>() {
      @Override
      public void customize(JList list, GitPushTagMode value, int index, boolean selected, boolean hasFocus) {
        setText(value.getTitle());
      }
    });
    myCombobox.setEnabled(myCheckBox.isSelected());
    if (defaultMode != null) {
      myCombobox.setSelectedItem(defaultMode);
    }

    myCheckBox.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(@NotNull ActionEvent e) {
        myCombobox.setEnabled(myCheckBox.isSelected());
      }
    });
    add(myCombobox, BorderLayout.CENTER);
  }
  else {
    myCombobox = null;
  }

}
项目:intellij-ce-playground    文件:GitCrlfDialog.java   
@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 = new LinkLabel("Read more", null, new LinkListener() {
    @Override
    public void linkSelected(LinkLabel aSource, Object aLinkData) {
      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;

}
项目:intellij-ce-playground    文件:HgBookmarkDialog.java   
@Override
@NotNull
protected JComponent createCenterPanel() {

  JPanel contentPanel = new JPanel(new GridBagLayout());
  GridBag g = new GridBag()
    .setDefaultInsets(new Insets(0, 0, DEFAULT_VGAP, DEFAULT_HGAP))
    .setDefaultAnchor(GridBagConstraints.LINE_START)
    .setDefaultFill(GridBagConstraints.HORIZONTAL);

  JLabel icon = new JLabel(UIUtil.getQuestionIcon(), SwingConstants.LEFT);
  myBookmarkName = new JBTextField(13);
  myBookmarkName.getDocument().addDocumentListener(new DocumentAdapter() {
    @Override
    public void textChanged(DocumentEvent e) {
      validateFields();
    }
  });

  JBLabel bookmarkLabel = new JBLabel("Bookmark name:");
  bookmarkLabel.setLabelFor(myBookmarkName);

  myActiveCheckbox = new JBCheckBox("Inactive", false);

  contentPanel.add(icon, g.nextLine().next().coverColumn(3).pady(DEFAULT_HGAP));
  contentPanel.add(bookmarkLabel, g.next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
  contentPanel.add(myBookmarkName, g.next().coverLine().setDefaultWeightX(1));
  contentPanel.add(myActiveCheckbox, g.nextLine().next().next().coverLine(2));
  return contentPanel;
}
项目:intellij-ce-playground    文件:GrInplaceParameterIntroducer.java   
@Override
protected JComponent getComponent() {

  JPanel previewPanel = new JPanel(new BorderLayout());
  previewPanel.add(getPreviewEditor().getComponent(), BorderLayout.CENTER);
  previewPanel.setBorder(new EmptyBorder(2, 2, 6, 2));

  DocumentAdapter documentAdapter = new DocumentAdapter() {
    @Override
    public void documentChanged(DocumentEvent e) {
      final TemplateState templateState = TemplateManagerImpl.getTemplateState(myEditor);
      if (templateState != null) {
        final TextResult value = templateState.getVariableValue(InplaceRefactoring.PRIMARY_VARIABLE_NAME);
        if (value != null) {
          updateTitle(getVariable(), value.getText());
        }
      }
    }
  };
  myEditor.getDocument().addDocumentListener(documentAdapter);

  myDelegateCB = new JBCheckBox("Delegate via overloading method");
  myDelegateCB.setMnemonic('l');
  myDelegateCB.setFocusable(false);

  JPanel panel = new JPanel(new BorderLayout());
  panel.add(previewPanel, BorderLayout.CENTER);
  panel.add(myDelegateCB, BorderLayout.SOUTH);
  return panel;
}
项目:intellij    文件:BlazeCommandRunConfiguration.java   
BlazeCommandRunConfigurationSettingsEditor(BlazeCommandRunConfiguration config) {
  Project project = config.getProject();
  targetField =
      new TextFieldWithAutoCompletion<>(
          project, new TargetCompletionProvider(project), true, null);
  elementState = config.elementState.clone();
  targetExpressionLabel = new JBLabel(UIUtil.ComponentStyle.LARGE);
  keepInSyncCheckBox = new JBCheckBox("Keep in sync with source XML");
  editorWithoutSyncCheckBox = UiUtil.createBox(targetExpressionLabel, targetField);
  editor = UiUtil.createBox(editorWithoutSyncCheckBox, keepInSyncCheckBox);
  updateEditor(config);
  updateHandlerEditor(config);
  keepInSyncCheckBox.addItemListener(e -> updateEnabledStatus());
}
项目:google-cloud-intellij    文件:CloudDebugRunConfigurationPanel.java   
private void createUIComponents() {
  hiddenValidationTrigger = new JBCheckBox();
  hiddenValidationTrigger.setVisible(false);

  projectSelector = new ProjectSelector(ideProject);
  projectSelector.addProjectSelectionListener(
      (selectedProject) -> {
        // settings editor does not see all the changes by default, use explicit notification.
        triggerValidation();
      });
}
项目:wuff-intellij-plugin    文件:WuffRunConfigurationEditor.java   
private Component createCheckboxPanel() {
    JPanel panel = new JPanel();
    panel.setBorder(BorderFactory.createTitledBorder(WuffBundle.message("wuff.run.config.launchparams")));
    for (JBCheckBox jb : launchConfigOptions) {
        panel.add(jb);
    }

    return panel;
}