本文整理匯總了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 + ")"));
}