本文整理汇总了Java中com.intellij.openapi.projectRoots.impl.SdkListCellRenderer类的典型用法代码示例。如果您正苦于以下问题:Java SdkListCellRenderer类的具体用法?Java SdkListCellRenderer怎么用?Java SdkListCellRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SdkListCellRenderer类属于com.intellij.openapi.projectRoots.impl包,在下文中一共展示了SdkListCellRenderer类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OCamlToolWindowSettingsForm
import com.intellij.openapi.projectRoots.impl.SdkListCellRenderer; //导入依赖的package包/类
public OCamlToolWindowSettingsForm(@NotNull final Project project) {
myProject = project;
final List<Sdk> allSdks = ProjectJdkTable.getInstance().getSdksOfType(OCamlSdkType.getInstance());
allSdks.add(0, null);
mySdkComboBox.setModel(new CollectionComboBoxModel(allSdks, null));
mySdkComboBox.setRenderer(new SdkListCellRenderer("<Project Default>"));
myConfigureButton.addActionListener(new ActionListener() {
public void actionPerformed(@NotNull final ActionEvent e) {
final ProjectJdksEditor editor = new ProjectJdksEditor((Sdk) mySdkComboBox.getSelectedItem(),
myProject, mySdkComboBox);
editor.show();
if (editor.isOK()) {
setSelectedSdk(editor.getSelectedJdk());
}
}
});
final FileChooserDescriptor workingDirChooserDescriptor = new FileChooserDescriptor(false, true, false, false, false, false);
workingDirChooserDescriptor.setRoot(myProject.getBaseDir());
myWorkingDirectoryEditor.addBrowseFolderListener("Select Working Directory", "", myProject, workingDirChooserDescriptor);
}
示例2: PyPluginCommonOptionsForm
import com.intellij.openapi.projectRoots.impl.SdkListCellRenderer; //导入依赖的package包/类
public PyPluginCommonOptionsForm(PyCommonOptionsFormData data) {
// setting modules
myProject = data.getProject();
final List<Module> validModules = data.getValidModules();
Collections.sort(validModules, new ModulesAlphaComparator());
Module selection = validModules.size() > 0 ? validModules.get(0) : null;
myModuleComboBox.setModules(validModules);
myModuleComboBox.setSelectedModule(selection);
myInterpreterComboBox.setRenderer(new SdkListCellRenderer("<Project Default>"));
myWorkingDirectoryTextField.addBrowseFolderListener("Select Working Directory", "", data.getProject(),
FileChooserDescriptorFactory.createSingleFolderDescriptor());
ActionListener listener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
updateControls();
}
};
myUseSpecifiedSdkRadioButton.addActionListener(listener);
myUseModuleSdkRadioButton.addActionListener(listener);
myInterpreterComboBox.addActionListener(listener);
myModuleComboBox.addActionListener(listener);
setAnchor(myEnvsComponent.getLabel());
myDecorator = new HideableDecorator(myHideablePanel, "Environment", false) {
@Override
protected void on() {
super.on();
storeState();
}
@Override
protected void off() {
super.off();
storeState();
}
private void storeState() {
PropertiesComponent.getInstance().setValue(EXPAND_PROPERTY_KEY, String.valueOf(isExpanded()), "true");
}
};
myDecorator.setOn(PropertiesComponent.getInstance().getBoolean(EXPAND_PROPERTY_KEY, true));
myDecorator.setContentComponent(myMainPanel);
myPathMappingsComponent.setAnchor(myEnvsComponent.getLabel());
updateControls();
}
示例3: updateDefaultInterpreter
import com.intellij.openapi.projectRoots.impl.SdkListCellRenderer; //导入依赖的package包/类
private void updateDefaultInterpreter(Module module) {
final Sdk sdk = module == null ? null : ModuleRootManager.getInstance(module).getSdk();
String projectSdkName = sdk == null ? "none" : sdk.getName();
myInterpreterComboBox.setRenderer(new SdkListCellRenderer("Project Default (" + projectSdkName + ")"));
}