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


Java ProgressIndicator.popState方法代码示例

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


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

示例1: init

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void init() {
  long start = System.currentTimeMillis();

  final ProgressIndicator progressIndicator = isDefault() ? null : ProgressIndicatorProvider.getGlobalProgressIndicator();
  if (progressIndicator != null) {
    progressIndicator.pushState();
  }
  super.init(progressIndicator);
  if (progressIndicator != null) {
    progressIndicator.popState();
  }

  long time = System.currentTimeMillis() - start;
  LOG.info(getComponentConfigCount() + " project components initialized in " + time + " ms");

  getMessageBus().syncPublisher(ProjectLifecycleListener.TOPIC).projectComponentsInitialized(this);

  //noinspection SynchronizeOnThis
  synchronized (this) {
    myProjectManagerListener = new MyProjectManagerListener();
    myProjectManager.addProjectManagerListener(this, myProjectManagerListener);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ProjectImpl.java

示例2: copyToMirror

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@NotNull
private File copyToMirror(@NotNull File original, @NotNull File mirror) {
  ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
  if (progress != null) {
    progress.pushState();
    progress.setText(VfsBundle.message("jar.copy.progress", original.getPath()));
    progress.setFraction(0);
  }

  try {
    FileUtil.copy(original, mirror);
  }
  catch (final IOException e) {
    reportIOErrorWithJars(original, mirror, e);
    return original;
  }

  if (progress != null) {
    progress.popState();
  }

  return mirror;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:JarHandler.java

示例3: processQuery

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void processQuery(@NotNull SchemaTypeParentsSearch.SearchParameters parameters, @NotNull Processor<SchemaTypeDef> consumer) {
  SchemaTypeDef baseType = parameters.schemaTypeDef;

  ProgressIndicator progress = ProgressIndicatorProvider.getGlobalProgressIndicator();
  if (progress != null) {
    progress.pushState();

    String typeName = ApplicationManager.getApplication().runReadAction((Computable<String>) baseType::getName);
    progress.setText(typeName == null ?
        "Searching for parents" : "Searching for parents of " + typeName
    );
  }

  try {
    processParents(consumer, baseType, parameters);
  } finally {
    if (progress != null) progress.popState();
  }
}
 
开发者ID:SumoLogic,项目名称:epigraph,代码行数:21,代码来源:SchemaTypeParentsSearcher.java

示例4: processQuery

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void processQuery(@NotNull SchemaTypeInheritorsSearch.SearchParameters parameters, @NotNull Processor<SchemaTypeDef> consumer) {
  SchemaTypeDef baseType = parameters.schemaTypeDef;

  ProgressIndicator progress = ProgressIndicatorProvider.getGlobalProgressIndicator();
  if (progress != null) {
    progress.pushState();

    String typeName = ApplicationManager.getApplication().runReadAction((Computable<String>) baseType::getName);
    progress.setText(typeName == null ?
        "Searching for inheritors" : "Searching for inheritors of " + typeName
    );
  }

  try {
    processInheritors(consumer, baseType, parameters);
  } finally {
    if (progress != null) progress.popState();
  }
}
 
开发者ID:SumoLogic,项目名称:epigraph,代码行数:21,代码来源:SchemaTypeInheritorsSearcher.java

示例5: processQuery

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
@Override
public void processQuery(@NotNull ClassInheritorsSearch.SearchParameters parameters, @NotNull Processor<PsiClass> consumer) {
  final PsiClass baseClass = parameters.getClassToProcess();
  final SearchScope searchScope = parameters.getScope();

  LOG.assertTrue(searchScope != null);

  ProgressIndicator progress = ProgressIndicatorProvider.getGlobalProgressIndicator();
  if (progress != null) {
    progress.pushState();
    String className = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
      @Override
      public String compute() {
        return baseClass.getName();
      }
    });
    progress.setText(className != null ?
                     PsiBundle.message("psi.search.inheritors.of.class.progress", className) :
                     PsiBundle.message("psi.search.inheritors.progress"));
  }

  processInheritors(consumer, baseClass, searchScope, parameters);

  if (progress != null) {
    progress.popState();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:JavaClassInheritorsSearcher.java

示例6: addClassesUsages

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private static boolean addClassesUsages(@NotNull PsiPackage aPackage,
                                        @NotNull final JavaPackageFindUsagesOptions options,
                                        @NotNull final Processor<UsageInfo> processor) {
  ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
  if (progress != null){
    progress.pushState();
  }

  List<PsiClass> classes = new ArrayList<PsiClass>();
  addClassesInPackage(aPackage, options.isIncludeSubpackages, classes);
  for (final PsiClass aClass : classes) {
    if (progress != null) {
      String name = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
        @Override
        public String compute() {
          return aClass.getName();
        }
      });
      progress.setText(FindBundle.message("find.searching.for.references.to.class.progress", name));
      progress.checkCanceled();
    }
    boolean success = ReferencesSearch.search(new ReferencesSearch.SearchParameters(aClass, options.searchScope, false, options.fastTrack)).forEach(new ReadActionProcessor<PsiReference>() {
      @Override
      public boolean processInReadAction(final PsiReference psiReference) {
        return addResult(psiReference, options, processor);
      }
    });
    if (!success) return false;
  }

  if (progress != null){
    progress.popState();
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:JavaFindUsagesHelper.java

示例7: executeCompileTasks

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private boolean executeCompileTasks(final CompileContext context, final boolean beforeTasks) {
  if (myProject.isDisposed()) {
    return false;
  }
  final CompilerManager manager = CompilerManager.getInstance(myProject);
  final ProgressIndicator progressIndicator = context.getProgressIndicator();
  progressIndicator.pushState();
  try {
    CompileTask[] tasks = beforeTasks ? manager.getBeforeTasks() : manager.getAfterTasks();
    if (tasks.length > 0) {
      progressIndicator.setText(beforeTasks
                                ? CompilerBundle.message("progress.executing.precompile.tasks")
                                : CompilerBundle.message("progress.executing.postcompile.tasks"));
      for (CompileTask task : tasks) {
        if (!task.execute(context)) {
          return false;
        }
      }
    }
  }
  finally {
    progressIndicator.popState();
    StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject);
    if (statusBar != null) {
      statusBar.setInfo("");
    }
    if (progressIndicator instanceof CompilerTask) {
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        public void run() {
          ((CompilerTask)progressIndicator).showCompilerContent();
        }
      });
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:CompileDriver.java

示例8: processGlobalRequestsOptimized

import com.intellij.openapi.progress.ProgressIndicator; //导入方法依赖的package包/类
private boolean processGlobalRequestsOptimized(@NotNull MultiMap<Set<IdIndexEntry>, RequestWithProcessor> singles,
                                               @NotNull ProgressIndicator progress,
                                               @NotNull final Map<RequestWithProcessor, Processor<PsiElement>> localProcessors) {
  if (singles.isEmpty()) {
    return true;
  }

  if (singles.size() == 1) {
    final Collection<? extends RequestWithProcessor> requests = singles.values();
    if (requests.size() == 1) {
      final RequestWithProcessor theOnly = requests.iterator().next();
      return processSingleRequest(theOnly.request, theOnly.refProcessor);
    }
  }

  progress.pushState();
  progress.setText(PsiBundle.message("psi.scanning.files.progress"));
  boolean result;

  try {
    // intersectionCandidateFiles holds files containing words from all requests in `singles` and words in corresponding container names
    final MultiMap<VirtualFile, RequestWithProcessor> intersectionCandidateFiles = createMultiMap();
    // restCandidateFiles holds files containing words from all requests in `singles` but EXCLUDING words in corresponding container names
    final MultiMap<VirtualFile, RequestWithProcessor> restCandidateFiles = createMultiMap();
    collectFiles(singles, progress, intersectionCandidateFiles, restCandidateFiles);

    if (intersectionCandidateFiles.isEmpty() && restCandidateFiles.isEmpty()) {
      return true;
    }

    final Set<String> allWords = new TreeSet<String>();
    for (RequestWithProcessor singleRequest : localProcessors.keySet()) {
      allWords.add(singleRequest.request.word);
    }
    progress.setText(PsiBundle.message("psi.search.for.word.progress", getPresentableWordsDescription(allWords)));

    if (intersectionCandidateFiles.isEmpty()) {
      result = processCandidates(localProcessors, restCandidateFiles, progress, restCandidateFiles.size(), 0);
    }
    else {
      int totalSize = restCandidateFiles.size() + intersectionCandidateFiles.size();
      result = processCandidates(localProcessors, intersectionCandidateFiles, progress, totalSize, 0);
      if (result) {
        result = processCandidates(localProcessors, restCandidateFiles, progress, totalSize, intersectionCandidateFiles.size());
      }
    }
  }
  finally {
    progress.popState();
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:54,代码来源:PsiSearchHelperImpl.java


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