當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。