コード例 #1
0
 @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;
 }
コード例 #2
0
 @Override
 public ModuleWizardStep[] createWizardSteps(
     WizardContext wizardContext,
     final ErlangModuleBuilder moduleBuilder,
     ModulesProvider modulesProvider) {
   return new ModuleWizardStep[] {
     new ProjectJdkForModuleStep(wizardContext, ErlangSdkType.getInstance()) {
       public void updateDataModel() {
         super.updateDataModel();
         moduleBuilder.setModuleJdk(getJdk());
       }
     }
   };
 }
コード例 #3
0
 @Override
 public boolean isSuitableSdkType(@NotNull SdkTypeId sdkType) {
   return sdkType == ErlangSdkType.getInstance();
 }