本文整理匯總了Java中com.intellij.openapi.progress.ProgressManager.runProcess方法的典型用法代碼示例。如果您正苦於以下問題:Java ProgressManager.runProcess方法的具體用法?Java ProgressManager.runProcess怎麽用?Java ProgressManager.runProcess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.progress.ProgressManager
的用法示例。
在下文中一共展示了ProgressManager.runProcess方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: implementersHaveOnlyPrivateConstructors
import com.intellij.openapi.progress.ProgressManager; //導入方法依賴的package包/類
private boolean implementersHaveOnlyPrivateConstructors(final PsiClass aClass) {
final GlobalSearchScope scope = GlobalSearchScope.allScope(aClass.getProject());
final PsiElementProcessor.CollectElementsWithLimit<PsiClass> processor = new PsiElementProcessor.CollectElementsWithLimit(6);
final ProgressManager progressManager = ProgressManager.getInstance();
progressManager.runProcess(new Runnable() {
@Override
public void run() {
ClassInheritorsSearch.search(aClass, scope, true, true).forEach(new PsiElementProcessorAdapter<PsiClass>(processor));
}
}, null);
if (processor.isOverflow()) {
return false;
}
final Collection<PsiClass> implementers = processor.getCollection();
for (PsiClass implementer : implementers) {
if (!implementer.isInterface() && !implementer.hasModifierProperty(PsiModifier.ABSTRACT)) {
if (!hasOnlyPrivateConstructors(implementer)) {
return false;
}
}
}
return true;
}
示例2: getUsageClass
import com.intellij.openapi.progress.ProgressManager; //導入方法依賴的package包/類
/**
* @return the class the specified method is used from, or null if it is
* used from 0 or more than 1 other classes.
*/
@Nullable
public PsiClass getUsageClass(final PsiMethod method) {
final ProgressManager progressManager = ProgressManager.getInstance();
final PsiSearchHelper searchHelper = PsiSearchHelper.SERVICE.getInstance(method.getProject());
final String name = method.getName();
final GlobalSearchScope scope = GlobalSearchScope.allScope(method.getProject());
if (searchHelper.isCheapEnoughToSearch(name, scope, null, progressManager.getProgressIndicator())
== PsiSearchHelper.SearchCostResult.TOO_MANY_OCCURRENCES) {
return null;
}
progressManager.runProcess(new Runnable() {
@Override
public void run() {
final Query<PsiReference> query = MethodReferencesSearch.search(method);
if (!query.forEach(UsageProcessor.this)) {
foundClass.set(null);
}
}
}, null);
return foundClass.get();
}
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:26,代碼來源:StaticMethodOnlyUsedInOneClassInspectionBase.java
示例3: getInheritors
import com.intellij.openapi.progress.ProgressManager; //導入方法依賴的package包/類
public Collection<PsiClass> getInheritors() {
final ProgressManager progressManager =
ProgressManager.getInstance();
// do not display progress
progressManager.runProcess(this, null);
return inheritors;
}
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:AbstractMethodWithMissingImplementationsInspection.java