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


Java ProgressManager.runProcess方法代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ObjectEqualityInspection.java

示例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


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