void () { final DependencyAnalysisResult result = createAnalysisResult(); final Task task; if (canStartInBackground()) { task = new Task.Backgroundable(myProject, getProgressTitle(), true, new PerformAnalysisInBackgroundOption(myProject)) { @Override public void run(@NotNull final ProgressIndicator indicator) { indicator.setIndeterminate(false); perform(result, indicator); } @Override public void onSuccess() { DependenciesHandlerBase.this.onSuccess(result); } }; } else { task = new Task.Modal(myProject, getProgressTitle(), true) { @Override public void run(@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(false); perform(result, indicator); } @Override public void onSuccess() { DependenciesHandlerBase.this.onSuccess(result); } }; } ProgressManager.getInstance().run(task); }