mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
in headless mmode use EmptyProgressIndicator instead of BackgroundableProgressIndicator
This commit is contained in:
+9
-2
@@ -289,9 +289,16 @@ public class ProgressManagerImpl extends ProgressManager {
|
||||
}
|
||||
|
||||
public static void runProcessWithProgressAsynchronously(final Task.Backgroundable task) {
|
||||
final BackgroundableProcessIndicator progressIndicator = new BackgroundableProcessIndicator(task);
|
||||
final ProgressIndicator progressIndicator;
|
||||
if (ApplicationManager.getApplication().isHeadlessEnvironment()) {
|
||||
progressIndicator = new EmptyProgressIndicator();
|
||||
}
|
||||
else {
|
||||
final BackgroundableProcessIndicator indicator = new BackgroundableProcessIndicator(task);
|
||||
Disposer.register(ApplicationManager.getApplication(), indicator);
|
||||
progressIndicator = indicator;
|
||||
}
|
||||
|
||||
Disposer.register(ApplicationManager.getApplication(), progressIndicator);
|
||||
|
||||
final Runnable process = new TaskRunnable(task, progressIndicator);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user