summaryrefslogtreecommitdiff
path: root/platform/core-api/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'platform/core-api/src/com')
-rw-r--r--platform/core-api/src/com/intellij/lang/ASTNode.java5
-rw-r--r--platform/core-api/src/com/intellij/openapi/options/SchemesManagerFactory.java10
-rw-r--r--platform/core-api/src/com/intellij/openapi/progress/EmptyProgressIndicator.java3
-rw-r--r--platform/core-api/src/com/intellij/openapi/progress/ProgressIndicatorProvider.java4
-rw-r--r--platform/core-api/src/com/intellij/openapi/progress/ProgressManager.java2
-rw-r--r--platform/core-api/src/com/intellij/openapi/util/ExecutionCallback.java3
-rw-r--r--platform/core-api/src/com/intellij/psi/util/PsiUtilCore.java11
-rw-r--r--platform/core-api/src/com/intellij/usageView/UsageInfo.java9
-rw-r--r--platform/core-api/src/com/intellij/util/PlatformUtilsCore.java6
9 files changed, 40 insertions, 13 deletions
diff --git a/platform/core-api/src/com/intellij/lang/ASTNode.java b/platform/core-api/src/com/intellij/lang/ASTNode.java
index fe603470ad3a..0b8be360b6a1 100644
--- a/platform/core-api/src/com/intellij/lang/ASTNode.java
+++ b/platform/core-api/src/com/intellij/lang/ASTNode.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -291,6 +291,5 @@ public interface ASTNode extends UserDataHolder {
* @param clazz expected psi class
* @return the PSI element.
*/
- @Nullable
- <T extends PsiElement> T getPsi(Class<T> clazz);
+ <T extends PsiElement> T getPsi(@NotNull Class<T> clazz);
}
diff --git a/platform/core-api/src/com/intellij/openapi/options/SchemesManagerFactory.java b/platform/core-api/src/com/intellij/openapi/options/SchemesManagerFactory.java
index f1a090359b68..a0c0ee7dad62 100644
--- a/platform/core-api/src/com/intellij/openapi/options/SchemesManagerFactory.java
+++ b/platform/core-api/src/com/intellij/openapi/options/SchemesManagerFactory.java
@@ -19,14 +19,16 @@ import com.intellij.openapi.components.RoamingType;
import com.intellij.openapi.components.ServiceBean;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.extensions.ExtensionPointName;
+import org.jetbrains.annotations.NotNull;
public abstract class SchemesManagerFactory {
- public static ExtensionPointName<ServiceBean> SCHEME_OWNER = ExtensionPointName.create("com.intellij.schemeOwner");
+ public static final ExtensionPointName<ServiceBean> SCHEME_OWNER = ExtensionPointName.create("com.intellij.schemeOwner");
- public abstract <T extends Scheme, E extends ExternalizableScheme> SchemesManager<T,E> createSchemesManager(String fileSpec, SchemeProcessor<E> processor,
- RoamingType roamingType);
+ public abstract <T extends Scheme, E extends ExternalizableScheme> SchemesManager<T, E> createSchemesManager(@NotNull String fileSpec,
+ @NotNull SchemeProcessor<E> processor,
+ @NotNull RoamingType roamingType);
- public static SchemesManagerFactory getInstance(){
+ public static SchemesManagerFactory getInstance() {
return ServiceManager.getService(SchemesManagerFactory.class);
}
diff --git a/platform/core-api/src/com/intellij/openapi/progress/EmptyProgressIndicator.java b/platform/core-api/src/com/intellij/openapi/progress/EmptyProgressIndicator.java
index d5603b2a28ae..4225270ed4b4 100644
--- a/platform/core-api/src/com/intellij/openapi/progress/EmptyProgressIndicator.java
+++ b/platform/core-api/src/com/intellij/openapi/progress/EmptyProgressIndicator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,6 +42,7 @@ public class EmptyProgressIndicator implements ProgressIndicator {
@Override
public void cancel() {
myIsCanceled = true;
+ ProgressIndicatorProvider.canceled();
}
@Override
diff --git a/platform/core-api/src/com/intellij/openapi/progress/ProgressIndicatorProvider.java b/platform/core-api/src/com/intellij/openapi/progress/ProgressIndicatorProvider.java
index afe440b8588f..89ff2fcd48a1 100644
--- a/platform/core-api/src/com/intellij/openapi/progress/ProgressIndicatorProvider.java
+++ b/platform/core-api/src/com/intellij/openapi/progress/ProgressIndicatorProvider.java
@@ -54,4 +54,8 @@ public abstract class ProgressIndicatorProvider {
ourInstance.doCheckCanceled();
}
}
+
+ public static void canceled() {
+ ourNeedToCheckCancel = true;
+ }
}
diff --git a/platform/core-api/src/com/intellij/openapi/progress/ProgressManager.java b/platform/core-api/src/com/intellij/openapi/progress/ProgressManager.java
index 4b4ace28cd37..3f0601ba951b 100644
--- a/platform/core-api/src/com/intellij/openapi/progress/ProgressManager.java
+++ b/platform/core-api/src/com/intellij/openapi/progress/ProgressManager.java
@@ -184,7 +184,7 @@ public abstract class ProgressManager extends ProgressIndicatorProvider {
throws ProcessCanceledException {
ProgressIndicator oldIndicator = null;
- boolean set = progress != null && progress != (oldIndicator = myThreadIndicator.get());
+ boolean set = progress != null && progress != (oldIndicator = getProgressIndicator());
if (set) {
myThreadIndicator.set(progress);
}
diff --git a/platform/core-api/src/com/intellij/openapi/util/ExecutionCallback.java b/platform/core-api/src/com/intellij/openapi/util/ExecutionCallback.java
index 40572e9f6a8e..5c72eb06def3 100644
--- a/platform/core-api/src/com/intellij/openapi/util/ExecutionCallback.java
+++ b/platform/core-api/src/com/intellij/openapi/util/ExecutionCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,6 +34,7 @@ class ExecutionCallback {
ExecutionCallback(int executedCount) {
myCountToExecution = executedCount;
+ assert executedCount >= 1 : executedCount;
}
/**
diff --git a/platform/core-api/src/com/intellij/psi/util/PsiUtilCore.java b/platform/core-api/src/com/intellij/psi/util/PsiUtilCore.java
index 8977da50f0ec..a33cf43573e4 100644
--- a/platform/core-api/src/com/intellij/psi/util/PsiUtilCore.java
+++ b/platform/core-api/src/com/intellij/psi/util/PsiUtilCore.java
@@ -17,9 +17,11 @@ package com.intellij.psi.util;
import com.intellij.lang.ASTNode;
import com.intellij.lang.Language;
+import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.Computable;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.vfs.VirtualFile;
@@ -516,4 +518,13 @@ public class PsiUtilCore {
}
return findLanguageFromElement(elt);
}
+
+ public static Project getProjectInReadAction(@NotNull final PsiElement element) {
+ return ApplicationManager.getApplication().runReadAction(new Computable<Project>() {
+ @Override
+ public Project compute() {
+ return element.getProject();
+ }
+ });
+ }
}
diff --git a/platform/core-api/src/com/intellij/usageView/UsageInfo.java b/platform/core-api/src/com/intellij/usageView/UsageInfo.java
index 2d3cecc3628b..e67958a21faf 100644
--- a/platform/core-api/src/com/intellij/usageView/UsageInfo.java
+++ b/platform/core-api/src/com/intellij/usageView/UsageInfo.java
@@ -246,6 +246,15 @@ public class UsageInfo {
return result;
}
+ @Override
+ public String toString() {
+ PsiReference reference = getReference();
+ if (reference == null) {
+ return super.toString();
+ }
+ return reference.getCanonicalText() + " (" + reference.getClass() + ")";
+ }
+
@Nullable
public PsiFile getFile() {
return mySmartPointer.getContainingFile();
diff --git a/platform/core-api/src/com/intellij/util/PlatformUtilsCore.java b/platform/core-api/src/com/intellij/util/PlatformUtilsCore.java
index 7e4ff81b69a1..0ea0b5a6eb60 100644
--- a/platform/core-api/src/com/intellij/util/PlatformUtilsCore.java
+++ b/platform/core-api/src/com/intellij/util/PlatformUtilsCore.java
@@ -22,7 +22,7 @@ public class PlatformUtilsCore {
public static final String IDEA_PREFIX = "idea";
public static final String COMMUNITY_PREFIX = "Idea";
public static final String APPCODE_PREFIX = "AppCode";
- public static final String CPP_PREFIX = "CppIde";
+ public static final String CLION_PREFIX = "CLion";
public static final String PYCHARM_PREFIX = "Python";
public static final String PYCHARM_PREFIX2 = "PyCharmCore";
public static final String RUBY_PREFIX = "Ruby";
@@ -59,8 +59,8 @@ public class PlatformUtilsCore {
return APPCODE_PREFIX.equals(getPlatformPrefix());
}
- public static boolean isCppIde() {
- return CPP_PREFIX.equals(getPlatformPrefix());
+ public static boolean isCLion() {
+ return CLION_PREFIX.equals(getPlatformPrefix());
}
public static boolean isPyCharm() {