Package com.intellij.openapi.roots.ex

Examples of com.intellij.openapi.roots.ex.ProjectRootManagerEx


        final ModifiableModuleModel moduleManager = createModuleManager(ideaProject);
        final ModifiableRootModel module = createModule(moduleManager, leinProjectFile.getParent().getPath(), name);
        initializeModulePaths(projectMap, module, leinProjectFile.getParent());

        ProjectRootManagerEx rootManager = ProjectRootManagerEx.getInstanceEx(ideaProject);
        module.setSdk(rootManager.getProjectSdk());

        //Setup the dependencies
        // Based loosely on org.jetbrains.idea.maven.importing.MavenRootModelAdapter#addLibraryDependency

        //We could use the module table here, but then the libraries wouldn't be shared across modules.
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);
        }
      });
      return moreSuitableSdk;
    }
    return selectedSdk;
View Full Code Here

TOP

Related Classes of com.intellij.openapi.roots.ex.ProjectRootManagerEx

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.