public abstract class SdkType extends java.lang.Object implements SdkTypeId
Modifier and Type | Field and Description |
---|---|
static ExtensionPointName<SdkType> |
EP_NAME |
Constructor and Description |
---|
SdkType(java.lang.String name) |
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.
|
boolean |
allowCreationByUser()
If this method returns false, this SDK type will not be shown in the SDK type chooser popup when the user
creates a new SDK.
|
abstract AdditionalDataConfigurable |
createAdditionalDataConfigurable(SdkModel sdkModel,
SdkModificator sdkModificator) |
boolean |
equals(java.lang.Object o) |
static SdkType |
findByName(java.lang.String sdkName) |
static <T extends SdkType> |
findInstance(java.lang.Class<T> sdkTypeClass) |
static SdkType [] |
getAllTypes() |
java.util.Comparator<Sdk> |
getComparator()
Returns a comparator used to order SDKs in project or module settings combo boxes.
|
java.lang.String |
getDefaultDocumentationUrl(Sdk sdk) |
SdkType |
getDependencyType() |
java.lang.String |
getDownloadSdkUrl() |
java.lang.String |
getHelpTopic() |
FileChooserDescriptor |
getHomeChooserDescriptor() |
java.lang.String |
getHomeFieldLabel() |
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
isValidSdkHome(String) returned false for the path. |
java.lang.String |
getName() |
abstract java.lang.String |
getPresentableName() |
java.lang.String |
getVersionString(Sdk sdk) |
java.lang.String |
getVersionString(java.lang.String sdkHome) |
int |
hashCode() |
boolean |
isRelevantForFile(Project project,
VirtualFile file)
This method is used to decide if a given
VirtualFile has something in common
with this SdkType . |
boolean |
isRootTypeApplicable(OrderRootType type) |
abstract boolean |
isValidSdkHome(java.lang.String path) |
SdkAdditionalData |
loadAdditionalData(Element additional) |
SdkAdditionalData |
loadAdditionalData(Sdk currentSdk,
Element additional) |
boolean |
sdkHasValidPath(Sdk sdk)
Checks if the home directory of the specified SDK is valid.
|
java.lang.String |
sdkPath(VirtualFile homePath) |
void |
setupSdkPaths(Sdk sdk) |
boolean |
setupSdkPaths(Sdk sdk,
SdkModel sdkModel) |
void |
showCustomCreateUI(SdkModel sdkModel,
javax.swing.JComponent parentComponent,
Consumer<Sdk> sdkCreatedCallback)
Deprecated.
use
showCustomCreateUI(SdkModel, JComponent, Sdk, Consumer) method instead |
void |
showCustomCreateUI(SdkModel sdkModel,
javax.swing.JComponent parentComponent,
Sdk selectedSdk,
Consumer<Sdk> sdkCreatedCallback)
Shows the custom SDK create UI based on selected SDK in parent component.
|
abstract 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.
|
abstract java.lang.String |
suggestSdkName(java.lang.String currentSdkName,
java.lang.String sdkHome) |
boolean |
supportsCustomCreateUI()
If this method returns true, instead of showing the standard file path chooser when a new SDK of the type is created,
the
showCustomCreateUI(com.intellij.openapi.projectRoots.SdkModel, javax.swing.JComponent, com.intellij.openapi.projectRoots.Sdk, com.intellij.util.Consumer<com.intellij.openapi.projectRoots.Sdk>) method is called. |
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isLocalSdk, saveAdditionalData, versionComparator, versionStringComparator
public static final ExtensionPointName<SdkType> EP_NAME
public abstract java.lang.String suggestHomePath()
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).public java.util.Collection<java.lang.String> suggestHomePaths()
["/usr/bin/python2", "/usr/bin/python3"]
.public boolean isRelevantForFile(Project project, VirtualFile file)
VirtualFile
has something in common
with this SdkType
.
For example, it can be used by the IDE to decide showing SDK related editor notifications or quick fixespublic java.lang.String adjustSelectedSdkHome(java.lang.String homePath)
homePath
- the path selected in the file chooser.public abstract boolean isValidSdkHome(java.lang.String path)
public java.lang.String getInvalidHomeMessage(java.lang.String path)
isValidSdkHome(String)
returned false for the path.public java.lang.String getVersionString(Sdk sdk)
getVersionString
in interface SdkTypeId
public java.lang.String getVersionString(java.lang.String sdkHome)
public abstract java.lang.String suggestSdkName(java.lang.String currentSdkName, java.lang.String sdkHome)
public java.util.Comparator<Sdk> getComparator()
public void setupSdkPaths(Sdk sdk)
public abstract AdditionalDataConfigurable createAdditionalDataConfigurable(SdkModel sdkModel, SdkModificator sdkModificator)
public SdkAdditionalData loadAdditionalData(Element additional)
public SdkAdditionalData loadAdditionalData(Sdk currentSdk, Element additional)
loadAdditionalData
in interface SdkTypeId
public abstract java.lang.String getPresentableName()
public javax.swing.Icon getIcon()
public java.lang.String getHelpTopic()
public javax.swing.Icon getIconForAddAction()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public FileChooserDescriptor getHomeChooserDescriptor()
public java.lang.String getHomeFieldLabel()
public java.lang.String getDefaultDocumentationUrl(Sdk sdk)
public java.lang.String getDownloadSdkUrl()
public static SdkType [] getAllTypes()
public static SdkType findByName(java.lang.String sdkName)
public static <T extends SdkType> T findInstance(java.lang.Class<T> sdkTypeClass)
public SdkType getDependencyType()
JavaSdkType
,
null otherwisepublic boolean isRootTypeApplicable(OrderRootType type)
public boolean supportsCustomCreateUI()
showCustomCreateUI(com.intellij.openapi.projectRoots.SdkModel, javax.swing.JComponent, com.intellij.openapi.projectRoots.Sdk, com.intellij.util.Consumer<com.intellij.openapi.projectRoots.Sdk>)
method is called.public void showCustomCreateUI(SdkModel sdkModel, javax.swing.JComponent parentComponent, Sdk selectedSdk, Consumer<Sdk> sdkCreatedCallback)
sdkModel
- the list of SDKs currently displayed in the configuration dialog.parentComponent
- the parent component for showing the dialog.selectedSdk
- current selected sdk in parentComponentsdkCreatedCallback
- the callback to which the created SDK is passed.supportsCustomCreateUI()
@Deprecated public void showCustomCreateUI(SdkModel sdkModel, javax.swing.JComponent parentComponent, Consumer<Sdk> sdkCreatedCallback)
showCustomCreateUI(SdkModel, JComponent, Sdk, Consumer)
method insteadpublic boolean sdkHasValidPath(Sdk sdk)
sdk
- the SDK to validate the path for.public java.lang.String sdkPath(VirtualFile homePath)
public boolean allowCreationByUser()