Package com.intellij.openapi.progress

Examples of com.intellij.openapi.progress.ProgressIndicator


        UsageSearcher usageSearcher = myUsageSearcherFactory.create();
        usageSearcher.generate(new Processor<Usage>() {
          public boolean process(final Usage usage) {
            if (usageViewManager.searchHasBeenCancelled()) return false;
            appendUsageLater(usage);
            ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
            return indicator == null || !indicator.isCanceled();
          }
        });

        setSearchInProgress(false);
      }
View Full Code Here


      fileIndex = ProjectRootManager.getInstance(myElement.getProject()).getFileIndex();
    } else {
      //can't be
      fileIndex = null;
    }
    final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();

    return new PsiRecursiveElementVisitor() {
      public void visitFile(PsiFile file) {
        if (/*file instanceof PsiJavaFile && */mySearchInLibraries || !(file instanceof PsiCompiledElement)) {
          final VirtualFile virtualFile = file.getVirtualFile();
          if (virtualFile == null) return;
          if (!myIncludeTestSource){
            if (fileIndex == null || fileIndex.isInTestSourceContent(virtualFile)){
              return;
            }
          }
          myFilesSet.add(virtualFile);
          if (indicator != null){
            indicator.setText(AnalysisScopeBundle.message("scanning.scope.progress.title"));
            indicator.setText2(VfsUtil.calcRelativeToProjectPath(virtualFile, file.getProject()));
          }
        }
      }
    };
  }
View Full Code Here

      });
    } else {
      file.accept(visitor);
      psiManager.dropResolveCaches();
    }
    final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
    return indicator == null || !indicator.isCanceled();
  }
View Full Code Here

    return name;
  }

  public int getFileCount() {
    if (myFilesSet == null) initFilesSet();
    final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
    if (indicator != null) { //clear text after building analysis scope set
      indicator.setText("");
      indicator.setText2("");
    }
    return myFilesSet.size();
  }
View Full Code Here

  }

  private void executeCompileTask(final CompileScope scope, final boolean isRebuild, final boolean forceCompile, final CompileStatusNotification callback, final CompilerMessage message, final boolean checkCachesVersion, CompilerTask compileTask, final CompileContextImpl compileContext) {
    final Runnable compileWork = new Runnable() {
      public void run() {
        final ProgressIndicator indicator = compileContext.getProgressIndicator();
        if (indicator.isCanceled() || myProject.isDisposed()) {
          if (callback != null) {
            callback.finished(true, 0, 0, compileContext);
          }
          return;
        }
        try {
          LOG.info("RUST COMPILATION STARTED (BUILD PROCESS)");
          if (message != null) {
            compileContext.addMessage(message);
          }
          if (isRebuild) {
            CompilerUtil.runInContext(compileContext, "Clearing build system data...", new ThrowableRunnable<Throwable>() {
              @Override
              public void run() throws Throwable {
                CompilerCacheManager.getInstance(myProject).clearCaches(compileContext);
              }
            });
          }
          final boolean beforeTasksOk = executeCompileTasks(compileContext, true);

          final int errorCount = compileContext.getMessageCount(CompilerMessageCategory.ERROR);
          if (!beforeTasksOk || errorCount > 0) {
            COMPILE_SERVER_BUILD_STATUS.set(compileContext, errorCount > 0? ExitStatus.ERRORS : ExitStatus.CANCELLED);
            return;
          }

          final RequestFuture future = compileInExternalProcess(compileContext, false);
          if (future != null) {
            while (!future.waitFor(200L , TimeUnit.MILLISECONDS)) {
              if (indicator.isCanceled()) {
                future.cancel(false);
              }
            }
            if (!executeCompileTasks(compileContext, false)) {
              COMPILE_SERVER_BUILD_STATUS.set(compileContext, ExitStatus.CANCELLED);
View Full Code Here

  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();
      WindowManager.getInstance().getStatusBar(myProject).setInfo("");
      if (progressIndicator instanceof CompilerTask) {
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          public void run() {
            ((CompilerTask)progressIndicator).showCompilerContent();
View Full Code Here

      protected void handleCompileMessage(UUID sessionId, CmdlineRemoteProto.Message.BuilderMessage.CompileMessage message) {
        final CmdlineRemoteProto.Message.BuilderMessage.CompileMessage.Kind kind = message.getKind();
        //System.out.println(compilerMessage.getText());
        final String messageText = message.getText();
        if (kind == CmdlineRemoteProto.Message.BuilderMessage.CompileMessage.Kind.PROGRESS) {
          final ProgressIndicator indicator = compileContext.getProgressIndicator();
          indicator.setText(messageText);
          if (message.hasDone()) {
            indicator.setFraction(message.getDone());
          }
        }
        else {
          final CompilerMessageCategory category = kind == CmdlineRemoteProto.Message.BuilderMessage.CompileMessage.Kind.ERROR ? CompilerMessageCategory.ERROR
              : kind == CmdlineRemoteProto.Message.BuilderMessage.CompileMessage.Kind.WARNING ? CompilerMessageCategory.WARNING : CompilerMessageCategory.INFORMATION;
View Full Code Here

      for (final String path : CompilerPathsEx.getOutputPaths(affectedModules)) {
        outputs.add(new File(path));
      }
      final LocalFileSystem lfs = LocalFileSystem.getInstance();
      if (!outputs.isEmpty()) {
        final ProgressIndicator indicator = compileContext.getProgressIndicator();
        indicator.setText("Synchronizing output directories...");
        CompilerUtil.refreshOutputDirectories(outputs, _status == ExitStatus.CANCELLED);
        indicator.setText("");
      }
      if (compileContext.isAnnotationProcessorsEnabled() && !myProject.isDisposed()) {
        final Set<File> genSourceRoots = new THashSet<File>(FileUtil.FILE_HASHING_STRATEGY);
        final CompilerConfiguration config = CompilerConfiguration.getInstance(myProject);
        for (Module module : affectedModules) {
View Full Code Here

      }
    }, 717);
  }

  private static void cancel() {
    final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
    if (indicator != null) {
      indicator.cancel();
    }
  }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.progress.ProgressIndicator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.