Package com.intellij.openapi.projectRoots

Examples of com.intellij.openapi.projectRoots.Sdk


                             @Nullable ModifiableArtifactModel modifiableArtifactModel) {
    Set<String> selectedAppNames = ContainerUtil.newHashSet();
    for (ImportedOtpApp importedOtpApp : mySelectedOtpApps) {
      selectedAppNames.add(importedOtpApp.getName());
    }
    Sdk projectSdk = fixProjectSdk(project);
    List<Module> createdModules = new ArrayList<Module>();
    final List<ModifiableRootModel> createdRootModels = new ArrayList<ModifiableRootModel>();
    final ModifiableModuleModel obtainedModuleModel =
      moduleModel != null ? moduleModel : ModuleManager.getInstance(project).getModifiableModel();
    for (ImportedOtpApp importedOtpApp : mySelectedOtpApps) {
View Full Code Here


  }

  @Nullable
  private static Sdk fixProjectSdk(@NotNull Project project) {
    final ProjectRootManagerEx projectRootMgr = ProjectRootManagerEx.getInstanceEx(project);
    Sdk selectedSdk = projectRootMgr.getProjectSdk();
    if (selectedSdk == null || selectedSdk.getSdkType() != ErlangSdkType.getInstance()) {
      final Sdk moreSuitableSdk = ProjectJdkTable.getInstance().findMostRecentSdkOfType(ErlangSdkType.getInstance());
      ApplicationManager.getApplication().runWriteAction(new Runnable() {
        @Override
        public void run() {
          projectRootMgr.setProjectSdk(moreSuitableSdk);
        }
View Full Code Here

  protected void setUpProjectSdk() {
    ApplicationManager.getApplication().runWriteAction(new Runnable() {
      @Override
      public void run() {
        Sdk sdk = getProjectDescriptor().getSdk();
        ProjectJdkTable.getInstance().addJdk(sdk);
        ProjectRootManager.getInstance(myFixture.getProject()).setProjectSdk(sdk);
      }
    });
  }
View Full Code Here

public class ErlangR17SyntaxInspection extends ErlangInspectionBase {
  @Override
  protected boolean canRunOn(@NotNull ErlangFile file) {
    Module module = ModuleUtilCore.findModuleForPsiElement(file);
    Sdk sdk = module == null ? null : ModuleRootManager.getInstance(module).getSdk();
    ErlangSdkRelease release = sdk != null ? ErlangSdkType.getRelease(sdk) : null;
    return release == null || !release.isNewerThan(ErlangSdkRelease.R17);
  }
View Full Code Here

      ErlangFunction implicitFunction = getExternalFunction("erlang");
      if (implicitFunction != null) return implicitFunction;

      Module module = ModuleUtilCore.findModuleForPsiElement(erlangFile);
      Sdk sdk = module == null ? null : ModuleRootManager.getInstance(module).getSdk();
      ErlangSdkRelease release = sdk != null ? ErlangSdkType.getRelease(sdk) : null;

      if ((release == null || release.needBifCompletion("erlang")) && ErlangBifTable.isBif("erlang", myReferenceName, myArity)) {
        return getElement();
      }
View Full Code Here

  private static String getSdkPath(@NotNull Project project) {
    if (ErlangSystemUtil.isSmallIde()) {
      return ErlangExternalToolsConfigurable.getErlangSdkPath(project);
    }
    else {
      Sdk projectSdk = ProjectRootManager.getInstance(project).getProjectSdk();
      return projectSdk != null ? StringUtil.notNullize(projectSdk.getHomePath()) : "";
    }
  }
View Full Code Here

    return workingDirPath;
  }

  @NotNull
  static String getErlPath(@NotNull Project project, @Nullable Module module) throws ExecutionException {
    Sdk sdk;
    if (module != null) {
      sdk = ModuleRootManager.getInstance(module).getSdk();
    }
    else {
      sdk = ProjectRootManager.getInstance(project).getProjectSdk();
    }
    if (sdk == null) {
      throw new ExecutionException("Erlang SDK is not configured");
    }
    return sdk.getHomePath() + File.separator + "bin" + File.separator + "erl";
  }
View Full Code Here

    if (vFile == null || vFile.getFileType() != ErlangFileType.MODULE) return null;
    String canonicalPath = vFile.getCanonicalPath();
    if (canonicalPath == null) return null;
    Module module = ModuleUtilCore.findModuleForPsiElement(file);
    if (module == null) return null;
    Sdk sdk = ModuleRootManager.getInstance(module).getSdk();
    if (sdk == null) return null;
    String homePath = sdk.getHomePath();
    if (homePath == null) return null;

    InspectionProfile profile = InspectionProjectProfileManager.getInstance(file.getProject()).getInspectionProfile();
    HighlightDisplayKey key = HighlightDisplayKey.find(ErlangDialyzerInspection.INSPECTION_SHORT_NAME);
    if (!profile.isToolEnabled(key)) return null;
View Full Code Here

  @Override
  public void checkConfiguration() throws RuntimeConfigurationException {
    Module selectedModule = getConfigurationModule().getModule();
    if (selectedModule == null) {
      Sdk projectSdk = ProjectRootManager.getInstance(getProject()).getProjectSdk();
      if (projectSdk == null || projectSdk.getSdkType() != ErlangSdkType.getInstance()) {
        throw new RuntimeConfigurationException("Neither Erlang module selected nor Erlang SDK is configured for the project");
      }
    }
    else {
      Sdk moduleSdk = ModuleRootManager.getInstance(selectedModule).getSdk();
      if (moduleSdk == null || moduleSdk.getSdkType() != ErlangSdkType.getInstance()) {
        throw new RuntimeConfigurationException("Erlang SDK is not configured for the selected module");
      }
    }
  }
View Full Code Here

  @Override
  protected LightProjectDescriptor getProjectDescriptor() {
    return new DefaultLightProjectDescriptor() {
      @Override
      public Sdk getSdk() {
        Sdk mockSdk = ErlangSdkType.createMockSdk(ERLANG_SDK_PATH);
        // Set local SDK documentation path
        SdkModificator sdkModificator = mockSdk.getSdkModificator();
        VirtualFile localDocDir = LocalFileSystem.getInstance().findFileByPath(ERLANG_DOC_PATH);
        sdkModificator.addRoot(localDocDir, JavadocOrderRootType.getInstance());
        sdkModificator.commitChanges();
        return mockSdk;
      }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.projectRoots.Sdk

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.