本文整理汇总了Java中com.intellij.ui.components.JBCheckBox类的典型用法代码示例。如果您正苦于以下问题:Java JBCheckBox类的具体用法?Java JBCheckBox怎么用?Java JBCheckBox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JBCheckBox类属于com.intellij.ui.components包,在下文中一共展示了JBCheckBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUIComponents
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
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"));
}
示例2: getOptionsPanel
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
@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;
}
示例3: installRenderers
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
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());
}
});
}
示例4: XmlEmmetConfigurable
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
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();
}
示例5: reset
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
@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));
}
}
}
示例6: createCustomPanel
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
@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();
}
示例7: BlazeIntellijPluginConfigurationSettingsEditor
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
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());
}
示例8: applyEditorTo
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
@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());
}
示例9: setCurrentValuesToControls
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
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());
}
示例10: createCenterPanel
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
@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;
}
示例11: createCustomPanel
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
@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();
}
示例12: createUIComponents
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
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);
}
示例13: GenerateDialog
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
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();
}
示例14: getOptionsPanel
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
@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;
}
示例15: getOptionsPanel
import com.intellij.ui.components.JBCheckBox; //导入依赖的package包/类
@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;
}