Package com.intellij.openapi.progress

Examples of com.intellij.openapi.progress.ProgressIndicator


          return true;
        }
      }
    };

    final ProgressIndicator indicator = FindUsagesManager.startProcessUsages(handler, handler.getPrimaryElements(), handler.getSecondaryElements(), collect, options, new Runnable() {
      @Override
      public void run() {
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          @Override
          public void run() {
            Disposer.dispose(processIcon);
            Container parent = processIcon.getParent();
            parent.remove(processIcon);
            parent.repaint();
            pingEDT.ping(); // repaint title
            synchronized (usages) {
              if (visibleNodes.isEmpty()) {
                if (usages.isEmpty()) {
                  String text = UsageViewBundle.message("no.usages.found.in", searchScopePresentableName(options, project));
                  showHint(text, editor, popupPosition, handler, maxUsages, options);
                  popup.cancel();
                }
                else {
                  // all usages filtered out
                }
              }
              else if (visibleNodes.size() == 1) {
                if (usages.size() == 1) {
                  //the only usage
                  Usage usage = visibleNodes.iterator().next().getUsage();
                  usage.navigate(true);
                  //String message = UsageViewBundle.message("show.usages.only.usage", searchScopePresentableName(options, project));
                  //navigateAndHint(usage, message, handler, popupPosition, maxUsages, options);
                  popup.cancel();
                }
                else {
                  assert usages.size() > 1 : usages;
                  // usage view can filter usages down to one
                  Usage visibleUsage = visibleNodes.iterator().next().getUsage();
                  if (areAllUsagesInOneLine(visibleUsage, usages)) {
                    String hint = UsageViewBundle.message("all.usages.are.in.this.line", usages.size(), searchScopePresentableName(options, project));
                    navigateAndHint(visibleUsage, hint, handler, popupPosition, maxUsages, options);
                    popup.cancel();
                  }
                }
              }
              else {
                String title = presentation.getTabText();
                boolean shouldShowMoreSeparator = visibleNodes.contains(MORE_USAGES_SEPARATOR_NODE);
                String fullTitle = getFullTitle(usages, title, shouldShowMoreSeparator, visibleNodes.size() - (shouldShowMoreSeparator ? 1 : 0), false);
                ((AbstractPopup)popup).setCaption(fullTitle);
              }
            }
          }
        }, project.getDisposed());
      }
    });
    Disposer.register(popup, new Disposable() {
      @Override
      public void dispose() {
        indicator.cancel();
      }
    });
  }
View Full Code Here


      Thread.sleep(500);
    } catch (final InterruptedException ignore) {
      Thread.interrupted();
    }
    //monitor.done();
    final ProgressIndicator progressIndicator = _findBugsTask.getProgressIndicator();
    if (progressIndicator != null) {
      progressIndicator.finishNonCancelableSection();
    }

    if (_isInspectionRun) {
      EventManagerImpl.getInstance().fireEvent(new BugReporterInspectionEventImpl(org.twodividedbyzero.idea.findbugs.common.event.types.BugReporterInspectionEvent.Operation.ANALYSIS_FINISHED, null, getBugCollection(), _project.getName(), _findBugsProject));
    } else {
View Full Code Here

    return _bugCollection;
  }


  public void observeClass(final ClassDescriptor classDescriptor) {
    final ProgressIndicator progressIndicator = _findBugsTask.getProgressIndicator();
    if (progressIndicator != null && progressIndicator.isCanceled()) {
      // causes break in FindBugs main loop
      Thread.currentThread().interrupt();

      if (_isInspectionRun) {
        EventManagerImpl.getInstance().fireEvent(new BugReporterInspectionEventImpl(org.twodividedbyzero.idea.findbugs.common.event.types.BugReporterInspectionEvent.Operation.ANALYSIS_ABORTED, _project.getName()));
View Full Code Here

  public void onEvent(@NotNull final BugReporterEvent event) {
    switch (event.getOperation()) {
      case ANALYSIS_STARTED:
        break;
      case ANALYSIS_ABORTED:
        final ProgressIndicator progressIndicator = _bugReporter.getFindBugsTask().getProgressIndicator();
        if (progressIndicator != null) {
          progressIndicator.cancel();
        }
        unregisterEventListener();
        break;
      case ANALYSIS_FINISHED:
        unregisterEventListener();
View Full Code Here

    setIndicatorText(text, null);
  }


  public void setIndicatorText2(final String text2) {
    final ProgressIndicator progressIndicator = getProgressIndicator();
    if (progressIndicator != null) {
      progressIndicator.setText2(text2);
    }
  }
View Full Code Here

    }
  }


  void setIndicatorText(final String text, @Nullable final String text2) {
    final ProgressIndicator progressIndicator = getProgressIndicator();
    if (progressIndicator != null) {
      progressIndicator.setText(text);

      if (text2 != null && text2.isEmpty() || text2 != null) {
        progressIndicator.setText(text2);
      }
    }
  }
View Full Code Here

        .resolved(false)
        .pageSize(-1);
    Issues issues = sonarClient.issueClient().find(query);
    builder.addAll(issues.list());
    for (int pageIndex = 2; pageIndex <= issues.paging().pages(); pageIndex++) {
      final ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
      if (progressIndicator.isCanceled())
        break;
      progressIndicator.setText2(pageIndex + " / " + issues.paging().pages());
      progressIndicator.setFraction(pageIndex * 1.0 / issues.paging().pages());

      query = IssueQuery.create()
          .componentRoots(resourceKey)
          .resolved(false)
          .pageSize(-1)
View Full Code Here

    final StreamGobbler errorGobbler = new StreamGobbler(process.getErrorStream(), sonarConsole, ERROR);
    final StreamGobbler outputGobbler = new StreamGobbler(process.getInputStream(), sonarConsole, INFO);
    errorGobbler.start();
    outputGobbler.start();

    final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
    indicator.setIndeterminate(true);

    while (outputGobbler.isAlive()) {
      if (indicator.isCanceled()) {
        process.destroy();
        break;
      }
    }
View Full Code Here

    libraryRoot2Errors.put(virtualFile, analysisContext.getErrors(DartFileBasedSource.getSource(project, virtualFile)).getErrors());
  }

  private static void setIndicatorText(String text) {
    final ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
    if (indicator != null) {
      ProgressWrapper.unwrap(indicator).setText(text);
    }
  }
View Full Code Here

      ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
        @Override
        public void run() {

          try {
            ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
            indicator.setText("Creating...");
            File tempProject = createTemp();
            PhoneGapCommandLine commandLine = new PhoneGapCommandLine(settings.getExecutable(), tempProject.getPath());

            if (!commandLine.isCorrectExecutable()) {
              showErrorMessage("Incorrect path");
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.