com.intellij.openapi.projectRoots.impl.ProjectJdkImpl Java Examples

The following examples show how to use com.intellij.openapi.projectRoots.impl.ProjectJdkImpl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OCamlAdditionalDataConfigurable.java    From reasonml-idea-plugin with MIT License 5 votes vote down vote up
@Override
public void setSdk(Sdk sdk) {
    m_sdk = sdk;
    SdkAdditionalData data = sdk.getSdkAdditionalData();
    if (data == null) {
        String versionString = sdk.getVersionString();
        if (versionString != null) {
            OCamlSdkAdditionalData oData = new OCamlSdkAdditionalData();
            oData.setVersionFromHome(versionString);
            ((ProjectJdkImpl) sdk).setSdkAdditionalData(oData);
        }
    }
}
 
Example #2
Source File: BaseSdkCompat.java    From intellij with Apache License 2.0 5 votes vote down vote up
/** #api193: SdkConfigurationUtil changed in 2020.1. */
public static ProjectJdkImpl createSdk(
    Collection<? extends Sdk> allSdks,
    VirtualFile homeDir,
    SdkType sdkType,
    @Nullable SdkAdditionalData additionalData,
    @Nullable String customSdkSuggestedName) {
  return SdkConfigurationUtil.createSdk(
      allSdks.toArray(new Sdk[0]), homeDir, sdkType, additionalData, customSdkSuggestedName);
}
 
Example #3
Source File: BaseSdkCompat.java    From intellij with Apache License 2.0 5 votes vote down vote up
/** #api193: SdkConfigurationUtil changed in 2020.1. */
public static ProjectJdkImpl createSdk(
    Collection<? extends Sdk> allSdks,
    VirtualFile homeDir,
    SdkType sdkType,
    @Nullable SdkAdditionalData additionalData,
    @Nullable String customSdkSuggestedName) {
  return SdkConfigurationUtil.createSdk(
      allSdks, homeDir, sdkType, additionalData, customSdkSuggestedName);
}
 
Example #4
Source File: HaxeSdkType.java    From intellij-haxe with Apache License 2.0 5 votes vote down vote up
/**
 * Try to automatically setup Haxe SDK if it's not configured yet.
 */
public void ensureSdk() {
  ProjectJdkTable sdkTable = ProjectJdkTable.getInstance();
  if(sdkTable.getSdksOfType(this).isEmpty()) {
    String homePath = HaxeSdkUtil.suggestHomePath();
    if(homePath != null) {
      Sdk sdk = new ProjectJdkImpl(getName(), this, homePath, getVersionString(homePath));
      setupSdkPaths(sdk);
      ApplicationManager.getApplication().runWriteAction(() -> sdkTable.addJdk(sdk));
    }
  }
}