Java Code Examples for com.intellij.openapi.progress.ProgressIndicator#start()

The following examples show how to use com.intellij.openapi.progress.ProgressIndicator#start() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: consulo   File:    License: Apache License 2.0 6 votes vote down vote up
public static <T> T runUnderDisposeAwareIndicator(@Nonnull Disposable parent, @Nonnull Computable<T> task) {
  ProgressIndicator indicator = new EmptyProgressIndicator(ModalityState.defaultModalityState());

  Disposable disposable = () -> {
    if (indicator.isRunning()) indicator.cancel();

  if (!registerIfParentNotDisposed(parent, disposable)) {
    throw new ProcessCanceledException();

  try {
    return ProgressManager.getInstance().runProcess(task, indicator);
  finally {
Example 2
Source Project: consulo   File:    License: Apache License 2.0 5 votes vote down vote up
public ProgressIndicator findMoreItems(@Nonnull Map<? extends SearchEverywhereContributor<?>, Collection<SearchEverywhereFoundElementInfo>> alreadyFound,
                                       @Nonnull String pattern,
                                       @Nonnull SearchEverywhereContributor<?> contributor,
                                       int newLimit) {
  ProgressIndicator indicator = new ProgressIndicatorBase();
  ResultsAccumulator accumulator = new ShowMoreResultsAccumulator(alreadyFound, myEqualityProvider, contributor, newLimit, myListener, myNotificationExecutor, indicator);
  Runnable task = createSearchTask(pattern, accumulator, indicator, contributor, () -> indicator.stop());

  return indicator;