public final class JavaSdkImpl extends JavaSdk
Constructor and Description |
---|
JavaSdkImpl() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
adjustSelectedSdkHome(java.lang.String homePath)
If a path selected in the file chooser is not a valid SDK home path, returns an adjusted version of the path that is again
checked for validity.
|
static boolean |
attachIDEAAnnotationsToJdk(SdkModificator modificator) |
static void |
attachJdkAnnotations(SdkModificator modificator) |
AdditionalDataConfigurable |
createAdditionalDataConfigurable(SdkModel sdkModel,
SdkModificator sdkModificator) |
Sdk |
createJdk(java.lang.String jdkName,
java.lang.String home,
boolean isJre) |
Sdk |
createMockJdk(java.lang.String jdkName,
java.lang.String home,
boolean isJre) |
java.lang.String |
getBinPath(Sdk sdk) |
java.lang.String |
getDefaultDocumentationUrl(Sdk sdk) |
java.lang.String |
getDownloadSdkUrl() |
java.lang.String |
getHelpTopic() |
FileChooserDescriptor |
getHomeChooserDescriptor() |
javax.swing.Icon |
getIcon() |
javax.swing.Icon |
getIconForAddAction() |
java.lang.String |
getInvalidHomeMessage(java.lang.String path)
Returns the message to be shown to the user when
SdkType.isValidSdkHome(String) returned false for the path. |
JavaVersion |
getJavaVersion(Sdk sdk) |
java.lang.String |
getPresentableName() |
java.lang.String |
getToolsPath(Sdk sdk) |
JavaSdkVersion |
getVersion(Sdk sdk) |
JavaSdkVersion |
getVersion(java.lang.String versionString) |
java.lang.String |
getVersionString(java.lang.String sdkHome) |
java.lang.String |
getVMExecutablePath(Sdk sdk) |
boolean |
isOfVersionOrHigher(Sdk sdk,
JavaSdkVersion version) |
boolean |
isRootTypeApplicable(OrderRootType type) |
boolean |
isValidSdkHome(java.lang.String path) |
void |
saveAdditionalData(SdkAdditionalData additionalData,
Element additional) |
void |
setupSdkPaths(Sdk sdk) |
boolean |
setupSdkPaths(Sdk sdk,
SdkModel sdkModel) |
java.lang.String |
suggestHomePath()
Returns a recommended starting path for a file chooser (where SDKs of this type are usually may be found),
or
null if not applicable/no SDKs found. |
java.util.Collection<java.lang.String> |
suggestHomePaths()
Returns a list of all valid SDKs found on this host.
|
java.lang.String |
suggestSdkName(java.lang.String currentSdkName,
java.lang.String sdkHome) |
java.util.Comparator<Sdk> |
versionComparator()
Note to implementors: you may need to override this method if SDKs of this type have non-trivial version strings.
|
java.util.Comparator<java.lang.String> |
versionStringComparator()
A comparator to compare versions of SDKs of that SdkType, e.g.
|
checkForJdk, checkForJre, createJdk, getInstance, isRelevantForFile
allowCreationByUser, equals, findByName, findInstance, getAllTypes, getComparator, getDependencyType, getHomeFieldLabel, getName, getVersionString, hashCode, loadAdditionalData, loadAdditionalData, sdkHasValidPath, sdkPath, showCustomCreateUI, showCustomCreateUI, supportsCustomCreateUI, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isDependent
isLocalSdk
public static final DataKey<java.lang.Boolean> KEY
public java.lang.String getPresentableName()
getPresentableName
in class SdkType
public java.lang.String getHelpTopic()
getHelpTopic
in class SdkType
public javax.swing.Icon getIconForAddAction()
getIconForAddAction
in class SdkType
public java.lang.String getDefaultDocumentationUrl(Sdk sdk)
getDefaultDocumentationUrl
in class SdkType
public java.lang.String getDownloadSdkUrl()
getDownloadSdkUrl
in class SdkType
public AdditionalDataConfigurable createAdditionalDataConfigurable(SdkModel sdkModel, SdkModificator sdkModificator)
createAdditionalDataConfigurable
in class SdkType
public void saveAdditionalData(SdkAdditionalData additionalData, Element additional)
public java.util.Comparator<Sdk> versionComparator()
SdkTypeId
public java.util.Comparator<java.lang.String> versionStringComparator()
SdkTypeId
Sdk.getVersionString()
or SdkType.getVersionString(com.intellij.openapi.projectRoots.Sdk)
SdkTypeId.versionComparator()
public java.lang.String getBinPath(Sdk sdk)
public java.lang.String getToolsPath(Sdk sdk)
public java.lang.String getVMExecutablePath(Sdk sdk)
public java.lang.String suggestHomePath()
SdkType
null
if not applicable/no SDKs found.
E.g. for Python SDK on Unix the method may return either "/usr/bin"
or "/usr/bin/python"
(if there is only one Python interpreter installed on a host).suggestHomePath
in class SdkType
public java.util.Collection<java.lang.String> suggestHomePaths()
SdkType
["/usr/bin/python2", "/usr/bin/python3"]
.suggestHomePaths
in class SdkType
public FileChooserDescriptor getHomeChooserDescriptor()
getHomeChooserDescriptor
in class SdkType
public java.lang.String adjustSelectedSdkHome(java.lang.String homePath)
SdkType
adjustSelectedSdkHome
in class SdkType
homePath
- the path selected in the file chooser.public boolean isValidSdkHome(java.lang.String path)
isValidSdkHome
in class SdkType
public java.lang.String getInvalidHomeMessage(java.lang.String path)
SdkType
SdkType.isValidSdkHome(String)
returned false for the path.getInvalidHomeMessage
in class SdkType
public java.lang.String suggestSdkName(java.lang.String currentSdkName, java.lang.String sdkHome)
suggestSdkName
in class SdkType
public boolean setupSdkPaths(Sdk sdk, SdkModel sdkModel)
setupSdkPaths
in class SdkType
public void setupSdkPaths(Sdk sdk)
setupSdkPaths
in class SdkType
public static void attachJdkAnnotations(SdkModificator modificator)
public static boolean attachIDEAAnnotationsToJdk(SdkModificator modificator)
public final java.lang.String getVersionString(java.lang.String sdkHome)
getVersionString
in class SdkType
public JavaSdkVersion getVersion(Sdk sdk)
getVersion
in class JavaSdk
public JavaVersion getJavaVersion(Sdk sdk)
public JavaSdkVersion getVersion(java.lang.String versionString)
getVersion
in class JavaSdk
public boolean isOfVersionOrHigher(Sdk sdk, JavaSdkVersion version)
isOfVersionOrHigher
in class JavaSdk
public Sdk createJdk(java.lang.String jdkName, java.lang.String home, boolean isJre)
public Sdk createMockJdk(java.lang.String jdkName, java.lang.String home, boolean isJre)
public boolean isRootTypeApplicable(OrderRootType type)
isRootTypeApplicable
in class SdkType