当前位置: 首页>>代码示例>>Java>>正文


Java ProjectJdkTable.getInstance方法代码示例

本文整理汇总了Java中com.intellij.openapi.projectRoots.ProjectJdkTable.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectJdkTable.getInstance方法的具体用法?Java ProjectJdkTable.getInstance怎么用?Java ProjectJdkTable.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.projectRoots.ProjectJdkTable的用法示例。


在下文中一共展示了ProjectJdkTable.getInstance方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createNewAndroidPlatform

import com.intellij.openapi.projectRoots.ProjectJdkTable; //导入方法依赖的package包/类
@Nullable
public static Sdk createNewAndroidPlatform(@NotNull IAndroidTarget target,
                                           @NotNull String sdkPath,
                                           @NotNull String sdkName,
                                           @Nullable Sdk jdk,
                                           boolean addRoots) {
  ProjectJdkTable table = ProjectJdkTable.getInstance();
  String tmpName = createUniqueSdkName(SDK_NAME, Arrays.asList(table.getAllJdks()));

  final Sdk sdk = table.createSdk(tmpName, AndroidSdkType.getInstance());

  SdkModificator sdkModificator = sdk.getSdkModificator();
  sdkModificator.setHomePath(sdkPath);
  sdkModificator.commitChanges();

  setUpSdk(sdk, sdkName, table.getAllJdks(), target, jdk, addRoots);

  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    @Override
    public void run() {
      ProjectJdkTable.getInstance().addJdk(sdk);
    }
  });
  return sdk;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:AndroidSdkUtils.java

示例2: getJavaSdk

import com.intellij.openapi.projectRoots.ProjectJdkTable; //导入方法依赖的package包/类
@Nullable
public Sdk getJavaSdk() {
  final ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();
  if (myJavaSdk == null) {
    if (myJavaSdkName != null) {
      myJavaSdk = jdkTable.findJdk(myJavaSdkName);
      myJavaSdkName = null;
    }
    else {
      for (Sdk jdk : jdkTable.getAllJdks()) {
        if (Jdks.isApplicableJdk(jdk)) {
          myJavaSdk = jdk;
          break;
        }
      }
    }
  }
  return myJavaSdk;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:AndroidSdkAdditionalData.java

示例3: testSatisfied

import com.intellij.openapi.projectRoots.ProjectJdkTable; //导入方法依赖的package包/类
public void testSatisfied() throws Exception {
  ProjectSdksModel model = new ProjectSdksModel();
  model.addSdk(IdeaTestUtil.getMockJdk17());
  ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();
  Sdk sdk = jdkTable.createSdk("a", AndroidSdkType.getInstance());
  mySdks.add(sdk);
  jdkTable.addJdk(sdk);
  AnAction action = getAddAction(model);
  try {
    action.actionPerformed(new TestActionEvent(action));
    fail("Exception should be thrown");
  }
  catch (Exception e) {
    assertEquals(AndroidBundle.message("cannot.parse.sdk.error"), e.getMessage());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AndroidSdkTypeNewProjectWizardTest.java

示例4: doTestSdkVersionAttributeValueCompletion

import com.intellij.openapi.projectRoots.ProjectJdkTable; //导入方法依赖的package包/类
private void doTestSdkVersionAttributeValueCompletion() throws Throwable {
  final ProjectJdkTable projectJdkTable = ProjectJdkTable.getInstance();
  final Sdk sdk = ModuleRootManager.getInstance(myModule).getSdk();

  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    @Override
    public void run() {
      projectJdkTable.addJdk(sdk);
    }
  });
  try {
    doTestCompletionVariants(getTestName(true) + ".xml", "1", "2", "3", "4", "5", "6", "7",
                             "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "MNC");
  }
  finally {
    ApplicationManager.getApplication().runWriteAction(new Runnable() {
      @Override
      public void run() {
        projectJdkTable.removeJdk(sdk);
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:AndroidManifestDomTest.java

示例5: getJavaSdk

import com.intellij.openapi.projectRoots.ProjectJdkTable; //导入方法依赖的package包/类
@Nullable
public Sdk getJavaSdk() {
  final ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();
  if (myJavaSdk == null) {
    if (myJavaSdkName != null) {
      myJavaSdk = jdkTable.findJdk(myJavaSdkName);
      myJavaSdkName = null;
    }
    else {
      for (Sdk jdk : jdkTable.getAllJdks()) {
        if (IdeaJdk.isValidInternalJdk(myCurrentJdk, jdk)) {
          myJavaSdk = jdk;
          break;
        }
      }
    }
  }
  return myJavaSdk;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:Sandbox.java

示例6: getJavaSdk

import com.intellij.openapi.projectRoots.ProjectJdkTable; //导入方法依赖的package包/类
@Nullable
public Sdk getJavaSdk() {
  if(javaSdk != null) {
    return javaSdk;
  }

  final ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();

  if(!isNullOrEmpty(javaSdkName)) {
    javaSdk = jdkTable.findJdk(javaSdkName);
    javaSdkName = null;
  } else {
    for(final Sdk jdk : jdkTable.getAllJdks()) {
      if(isApplicableJdk(jdk)) {
        javaSdk = jdk;
        break;
      }
    }
  }

  return javaSdk;
}
 
开发者ID:defrac,项目名称:defrac-plugin-intellij,代码行数:23,代码来源:DefracSdkAdditionalData.java

示例7: findJdk

import com.intellij.openapi.projectRoots.ProjectJdkTable; //导入方法依赖的package包/类
@Nullable
private static Sdk findJdk(final String sdkName, final String sdkType) {
  for (SdkFinder sdkFinder : SdkFinder.EP_NAME.getExtensions()) {
    final Sdk sdk = sdkFinder.findSdk(sdkName, sdkType);
    if (sdk != null) {
      return sdk;
    }
  }
  final ProjectJdkTable projectJdkTable = ProjectJdkTable.getInstance();
  return projectJdkTable.findJdk(sdkName, sdkType);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ModuleJdkOrderEntryImpl.java

示例8: tearDown

import com.intellij.openapi.projectRoots.ProjectJdkTable; //导入方法依赖的package包/类
@Override
protected void tearDown() throws Exception {
  super.tearDown();
  final ProjectJdkTable table = ProjectJdkTable.getInstance();

  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    @Override
    public void run() {
      for (Sdk sdk : table.getAllJdks()) {
        table.removeJdk(sdk);
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:AndroidFacetImporterTest.java

示例9: removeExistingAndroidSdks

import com.intellij.openapi.projectRoots.ProjectJdkTable; //导入方法依赖的package包/类
private static void removeExistingAndroidSdks() {
  ProjectJdkTable table = ProjectJdkTable.getInstance();

  List<Sdk> androidSdks = table.getSdksOfType(AndroidSdkType.getInstance());
  for (Sdk sdk : androidSdks) {
    table.removeJdk(sdk);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AndroidSdkUtilsTest.java

示例10: removeExistingAndroidSdks

import com.intellij.openapi.projectRoots.ProjectJdkTable; //导入方法依赖的package包/类
public static void removeExistingAndroidSdks() {
  final ProjectJdkTable table = ProjectJdkTable.getInstance();
  ApplicationManager.getApplication().runWriteAction(new Runnable() {
    @Override
    public void run() {
      for (Sdk sdk : table.getAllJdks()) {
        table.removeJdk(sdk);
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:AndroidTestCaseHelper.java

示例11: getAnAcceptableJdk

import com.intellij.openapi.projectRoots.ProjectJdkTable; //导入方法依赖的package包/类
/**
 * Gets an acceptable JDK.
 *
 * @return The JDK; or <code>null</code>.
 */
@Nullable
private Sdk getAnAcceptableJdk() {
    final ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();
    for (final Sdk jdk : jdkTable.getAllJdks()) {
        if (MetaborgSdkType.isAcceptableJdk(jdk, this.sdk)) {
            return jdk;
        }
    }
    return null;
}
 
开发者ID:metaborg,项目名称:spoofax-intellij,代码行数:16,代码来源:MetaborgSdkAdditionalData.java

示例12: getProjectJDK

import com.intellij.openapi.projectRoots.ProjectJdkTable; //导入方法依赖的package包/类
protected Sdk getProjectJDK()
    {
//        return ProjectJdkTable.getInstance().getInternalJdk();  -- pre-IDEA 8.0 syntax
        ProjectJdkTable projectJdkTable = ProjectJdkTable.getInstance();
        return ((JavaAwareProjectJdkTableImpl)projectJdkTable).getInternalJdk();
    }
 
开发者ID:DaveKriewall,项目名称:Rearranger,代码行数:7,代码来源:RearrangerTest.java

示例13: removeAllKnownJdks

import com.intellij.openapi.projectRoots.ProjectJdkTable; //导入方法依赖的package包/类
private static void removeAllKnownJdks() {
  ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();
  for (Sdk jdk : jdkTable.getAllJdks()) {
    jdkTable.removeJdk(jdk);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:AndroidGradleBuildProcessParametersProviderTest.java


注:本文中的com.intellij.openapi.projectRoots.ProjectJdkTable.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。