mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] checks 'ProgressIndicator.isCanceled()' right before finishing a task
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -473,17 +473,16 @@ public class CoreProgressManager extends ProgressManager implements Disposable {
|
||||
exception = e;
|
||||
}
|
||||
|
||||
final boolean finalCanceled = processCanceled || progressIndicator.isCanceled();
|
||||
final Throwable finalException = exception;
|
||||
|
||||
if (ApplicationManager.getApplication().isDispatchThread()) {
|
||||
finishTask(task, finalCanceled, finalException);
|
||||
finishTask(task, processCanceled || progressIndicator.isCanceled(), exception);
|
||||
}
|
||||
else {
|
||||
final boolean finalCanceled = processCanceled;
|
||||
final Throwable finalException = exception;
|
||||
ApplicationManager.getApplication().invokeAndWait(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
finishTask(task, finalCanceled, finalException);
|
||||
finishTask(task, finalCanceled || progressIndicator.isCanceled(), finalException);
|
||||
}
|
||||
}, modalityState);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user