本文整理汇总了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;
}
示例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;
}
示例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());
}
}
示例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);
}
});
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
});
}
示例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);
}
}
示例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);
}
}
});
}
示例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;
}
示例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();
}
示例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