use of com.microsoft.intellij.helpers.tasks.CancellableTaskHandleImpl in project azure-tools-for-java by Microsoft.
the class IDEHelperImpl method runInBackground.
@NotNull
@Override
public CancellableTask.CancellableTaskHandle runInBackground(@NotNull ProjectDescriptor projectDescriptor, @NotNull final String name, @Nullable final String indicatorText, @NotNull final CancellableTask cancellableTask) throws AzureCmdException {
final CancellableTaskHandleImpl handle = new CancellableTaskHandleImpl();
final Project project = findOpenProject(projectDescriptor);
// background tasks via ProgressManager can be scheduled only on the
// dispatch thread
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
ProgressManager.getInstance().run(getCancellableBackgroundTask(project, name, indicatorText, handle, cancellableTask));
}
}, ModalityState.any());
return handle;
}
Aggregations