本文整理汇总了Java中com.intellij.openapi.ui.ComboBox.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ComboBox.setEnabled方法的具体用法?Java ComboBox.setEnabled怎么用?Java ComboBox.setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.ui.ComboBox
的用法示例。
在下文中一共展示了ComboBox.setEnabled方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VcsUpdateInfoScopeFilterConfigurable
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
VcsUpdateInfoScopeFilterConfigurable(Project project, VcsConfiguration vcsConfiguration) {
myVcsConfiguration = vcsConfiguration;
myCheckbox = new JCheckBox(VcsBundle.getString("settings.filter.update.project.info.by.scope"));
myComboBox = new ComboBox();
myComboBox.setEnabled(myCheckbox.isSelected());
myCheckbox.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(@NotNull ChangeEvent e) {
myComboBox.setEnabled(myCheckbox.isSelected());
}
});
myNamedScopeHolders = NamedScopesHolder.getAllNamedScopeHolders(project);
for (NamedScopesHolder holder : myNamedScopeHolders) {
holder.addScopeListener(this);
}
}
示例2: doCreateCenterPanel
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
protected JComponent doCreateCenterPanel() {
JPanel panel = new JPanel(new BorderLayout(5, 0));
FilterRule.FilterRuleType[] types = FilterRule.FilterRuleType.values();
ruleType = new ComboBox(types);
ruleType.setEnabled(true);
ruleType.setSelectedIndex(0);
panel.add(ruleType, BorderLayout.WEST);
filterName = new JTextField(20);
PromptSupport.setPrompt("Set the string name here", filterName);
panel.add(filterName, BorderLayout.CENTER);
return panel;
}
示例3: CleanUnshelvedFilterDialog
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
public CleanUnshelvedFilterDialog(@Nullable Project project) {
super(project);
setTitle("Clean Unshelved Changelists");
mySystemUnshelvedButton = new JRadioButton("created automatically", true);
myUnshelvedWithFilterButton = new JRadioButton("older than one", false);
myAllUnshelvedButton = new JRadioButton("all", false);
myTimePeriodComboBox = new ComboBox(new EnumComboBoxModel<>(TimePeriod.class));
myTimePeriodComboBox.setEnabled(myUnshelvedWithFilterButton.isSelected());
myUnshelvedWithFilterButton.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
myTimePeriodComboBox.setEnabled(myUnshelvedWithFilterButton.isSelected());
}
});
setOKButtonText("Delete");
init();
setResizable(false);
}
示例4: GitPushTagPanel
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
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;
}
}
示例5: createComponent
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
@Nullable
@Override
public JComponent createComponent() {
if (settingPanel == null) {
settingPanel = new JPanel(new VerticalLayout(18));
// header UI
Container container = new Container();
container.setLayout(new BorderLayout());
currentEngine = TranslationEngineType.fromName(
PropertiesComponent.getInstance().getValue(StorageDataKey.SettingLanguageEngine));
TranslationEngineType[] items = TranslationEngineType.getLanguageEngineArray();
languageEngineBox = new ComboBox(items);
languageEngineBox.setEnabled(true);
languageEngineBox.setSelectedItem(currentEngine);
languageEngineBox.addActionListener(this);
container.add(new JLabel("Language engine: "), BorderLayout.WEST);
container.add(languageEngineBox, BorderLayout.CENTER);
settingPanel.add(container);
initContentContainer();
initAndAddFilterContainer();
}
return settingPanel;
}
示例6: buildProperties
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
private void buildProperties() {
// Header
JLabel jlName = new JLabel(Localizer.get("Name"));
JLabel jlDescription = new JLabel(Localizer.get("Description"));
jtfName = new JBTextField(packageTemplate.getName());
jtaDescription = new JTextArea(packageTemplate.getDescription());
panelProperties.add(jlName, new CC().wrap().spanX().pad(0, 0, 0, 8).gapY("0", "4pt"));
panelProperties.add(jtfName, new CC().spanX().growX().pushX().wrap());
panelProperties.add(jlDescription, new CC().wrap().spanX().pad(0, 0, 0, 8).gapY("4pt", "4pt"));
panelProperties.add(jtaDescription, new CC().spanX().growX().pushX().wrap().gapY("0", "4pt"));
//FileTemplate Source
ArrayList<FileTemplateSource> actionTypes = new ArrayList<>();
actionTypes.add(FileTemplateSource.DEFAULT_ONLY);
actionTypes.add(FileTemplateSource.PROJECT_ONLY);
actionTypes.add(FileTemplateSource.PROJECT_PRIORITY);
actionTypes.add(FileTemplateSource.DEFAULT_PRIORITY);
cboxFileTemplateSource = new ComboBox(actionTypes.toArray());
cboxFileTemplateSource.setRenderer(new FileTemplateSourceCellRenderer());
cboxFileTemplateSource.setSelectedItem(packageTemplate.getFileTemplateSource());
cboxFileTemplateSource.addActionListener (e -> {
packageTemplate.setFileTemplateSource((FileTemplateSource) cboxFileTemplateSource.getSelectedItem());
});
if (mode == ViewMode.USAGE) {
jtfName.setEditable(false);
jtaDescription.setEditable(false);
cboxFileTemplateSource.setEnabled(false);
} else {
// Properties
cbShouldRegisterAction = new JBCheckBox(Localizer.get("property.ShouldRegisterAction"), packageTemplate.isShouldRegisterAction());
cbSkipDefiningNames = new JBCheckBox(Localizer.get("property.SkipPresettings"), packageTemplate.isSkipDefiningNames());
panelProperties.add(cbShouldRegisterAction, new CC().wrap().spanX());
panelProperties.add(cbSkipDefiningNames, new CC().wrap().spanX());
}
// Properties
cbSkipRootDirectory = new JBCheckBox(Localizer.get("property.SkipRootDirectory"), packageTemplate.isSkipRootDirectory());
cbSkipRootDirectory.addItemListener(e -> {
collectDataFromFields();
reBuildElements();
});
cbShowReportDialog = new JBCheckBox(Localizer.get("property.ShowReportDialog"), packageTemplate.shouldShowReport());
panelProperties.add(cbSkipRootDirectory, new CC().spanX().wrap());
panelProperties.add(cbShowReportDialog, new CC().spanX().wrap());
panelProperties.add(new JLabel(Localizer.get("FileTemplateSource")), new CC().spanX().split(2));
panelProperties.add(cboxFileTemplateSource, new CC().pushX().growX().wrap());
}
示例7: createComponent
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
@Nullable
@Override
public JComponent createComponent() {
if (mComponent == null) {
mComponent = new JPanel();
mComponent.setLayout(new BorderLayout());
Box boxMain = Box.createVerticalBox();
// Output file encoding
JPanel ofePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
JLabel ofeLabel = new JLabel("Output file encoding");
mCurrentEncoding = mProperties.getValue(StorageDataKey.KEY_OUTPUT_FILE_ENCODING,
StorageDataKey.VALUE_OUTPUT_FILE_ENCODING_SYSTEM_DEFAULT);
String[] encodings = {
StorageDataKey.VALUE_OUTPUT_FILE_ENCODING_SYSTEM_DEFAULT,
StorageDataKey.VALUE_OUTPUT_FILE_ENCODING_UTF_8
};
mComboBoxOutputFileEncoding = new ComboBox(encodings);
mComboBoxOutputFileEncoding.setEnabled(true);
mComboBoxOutputFileEncoding.setSelectedItem(mCurrentEncoding);
mComboBoxOutputFileEncoding.addActionListener(this);
ofePanel.add(ofeLabel);
ofePanel.add(mComboBoxOutputFileEncoding);
// Ask before override
JPanel aboPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
mCheckBoxAskOverride = new JCheckBox("Ask before override");
mCurrentAskOverride = mProperties.getBoolean(StorageDataKey.KEY_ASK_BEFORE_OVERRIDE, true);
mCheckBoxAskOverride.setSelected(mCurrentAskOverride);
mCheckBoxAskOverride.addActionListener(this);
aboPanel.add(mCheckBoxAskOverride);
boxMain.add(ofePanel);
boxMain.add(aboPanel);
mComponent.add(BorderLayout.NORTH, boxMain);
}
return mComponent;
}