void (@NotNull ProgressIndicator indicator, @NotNull final Project project, @NotNull UsageSearcher usageSearcher, @NotNull Processor<? super Usage> processor, @NotNull Runnable onComplete) { ThreadingAssertions.assertEventDispatchThread(); Task.Backgroundable task = new Task.Backgroundable(project, FindBundle.message("progress.title.finding.usages")) { @Override public void run(@NotNull ProgressIndicator indicator) { usageSearcher.generate(processor); } }; ((ProgressManagerImpl)ProgressManager.getInstance()).runProcessWithProgressAsynchronously(task, indicator, onComplete); }