mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-156888 Simplify JDK setup for new projects: check for jdk validity
This commit is contained in:
@@ -30,7 +30,6 @@ import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.Conditions;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.ColoredListCellRenderer;
|
||||
import com.intellij.ui.ScreenUtil;
|
||||
@@ -328,14 +327,14 @@ public class JdkComboBox extends ComboBoxWithWidePopup<JdkComboBox.JdkComboBoxIt
|
||||
}
|
||||
|
||||
protected void addSuggestedItems(@Nullable Condition<SdkTypeId> sdkTypeFilter, Sdk[] jdks) {
|
||||
// todo remove it when unix is supported
|
||||
if (!SystemInfo.isWindows) return;
|
||||
SdkType[] types = SdkType.getAllTypes();
|
||||
for (SdkType type : types) {
|
||||
if (sdkTypeFilter == null || sdkTypeFilter.value(type) && ContainerUtil.find(jdks, sdk -> sdk.getSdkType() == type) == null) {
|
||||
Collection<String> paths = type.suggestHomePaths();
|
||||
for (String path : paths) {
|
||||
addElement(new SuggestedJdkItem(type, path));
|
||||
if (path != null && type.isValidSdkHome(path)) {
|
||||
addElement(new SuggestedJdkItem(type, path));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user