mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-53476 Gradle integration (Maven's level - dependencies, modules, repositories)
1. Using balloons instead of labels at the 'adjust project settings before importing' wizard step; 2. Exposed all project data at the 'adjust project settings before importing' wizard step; 3. Corrected 'deduced gradle home' notification processing; 4. Added ability to setup configured jdk for the imported project; 5. Added 'description' property to the JavaSdkVersion;
This commit is contained in:
@@ -18,22 +18,26 @@ package com.intellij.openapi.projectRoots;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Represents version of Java SDK. Use {@link JavaSdk#getVersion(Sdk)} method to obtain version of an {@link Sdk}
|
||||
*
|
||||
* @author nik
|
||||
*/
|
||||
public enum JavaSdkVersion {
|
||||
JDK_1_0(LanguageLevel.JDK_1_3), JDK_1_1(LanguageLevel.JDK_1_3), JDK_1_2(LanguageLevel.JDK_1_3), JDK_1_3(LanguageLevel.JDK_1_3),
|
||||
JDK_1_4(LanguageLevel.JDK_1_4),
|
||||
JDK_1_5(LanguageLevel.JDK_1_5),
|
||||
JDK_1_6(LanguageLevel.JDK_1_6),
|
||||
JDK_1_7(LanguageLevel.JDK_1_7),
|
||||
JDK_1_8(LanguageLevel.JDK_1_8);
|
||||
JDK_1_0(LanguageLevel.JDK_1_3, "1.0"), JDK_1_1(LanguageLevel.JDK_1_3, "1.1"), JDK_1_2(LanguageLevel.JDK_1_3, "1.2"), JDK_1_3(LanguageLevel.JDK_1_3, "1.3"),
|
||||
JDK_1_4(LanguageLevel.JDK_1_4, "1.4"),
|
||||
JDK_1_5(LanguageLevel.JDK_1_5, "1.5"),
|
||||
JDK_1_6(LanguageLevel.JDK_1_6, "1.6"),
|
||||
JDK_1_7(LanguageLevel.JDK_1_7, "1.7"),
|
||||
JDK_1_8(LanguageLevel.JDK_1_8, "1.8");
|
||||
private final LanguageLevel myMaxLanguageLevel;
|
||||
private final String myDescription;
|
||||
|
||||
JavaSdkVersion(@NotNull LanguageLevel maxLanguageLevel) {
|
||||
JavaSdkVersion(@NotNull LanguageLevel maxLanguageLevel, @NotNull String description) {
|
||||
myMaxLanguageLevel = maxLanguageLevel;
|
||||
myDescription = description;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -41,7 +45,29 @@ public enum JavaSdkVersion {
|
||||
return myMaxLanguageLevel;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getDescription() {
|
||||
return myDescription;
|
||||
}
|
||||
|
||||
public boolean isAtLeast(@NotNull JavaSdkVersion version) {
|
||||
return compareTo(version) >= 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + ", description: " + myDescription;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static JavaSdkVersion byDescription(@NotNull String description) throws IllegalArgumentException {
|
||||
for (JavaSdkVersion version : values()) {
|
||||
if (version.getDescription().equals(description)) {
|
||||
return version;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Can't map Java SDK by description (%s). Available values: %s", description, Arrays.toString(values()))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user