mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
split 'force' flag into two different ones: 'force' and 'exitConfirmed', so that now 'force==true' guarantees application shutdown; (fixes also IDEA-127009)
This commit is contained in:
@@ -61,7 +61,7 @@ public class GenerateAntApplication {
|
||||
GenerateAntApplication.LOG.error(e);
|
||||
}
|
||||
finally {
|
||||
application.exit(true);
|
||||
application.exit(true, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -53,11 +53,11 @@ public class MockApplicationEx extends MockApplication implements ApplicationEx
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exit(boolean force) {
|
||||
public void exit(boolean force, boolean exitConfirmed) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restart(boolean force) {
|
||||
public void restart(boolean exitConfirmed) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -61,9 +61,9 @@ public interface ApplicationEx extends Application {
|
||||
boolean isDoNotSave();
|
||||
|
||||
//force exit
|
||||
void exit(boolean force);
|
||||
void exit(boolean force, boolean exitConfirmed);
|
||||
|
||||
void restart(boolean force);
|
||||
void restart(boolean exitConfirmed);
|
||||
|
||||
/**
|
||||
* Runs modal process. For internal use only, see {@link Task}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class InspectionApplication {
|
||||
LOG.error(e);
|
||||
}
|
||||
finally {
|
||||
if (myErrorCodeRequired) application.exit(true);
|
||||
if (myErrorCodeRequired) application.exit(true, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -129,7 +129,7 @@ public class TraverseUIStarter implements ApplicationStarter {
|
||||
|
||||
System.out.println("Searchable options index builder completed");
|
||||
|
||||
((ApplicationEx)ApplicationManager.getApplication()).exit(true);
|
||||
((ApplicationEx)ApplicationManager.getApplication()).exit(true, true);
|
||||
}
|
||||
|
||||
private static void processFileTemplates(Element configurableElement) {
|
||||
|
||||
@@ -663,7 +663,7 @@ public abstract class PluginManagerMain implements Disposable {
|
||||
app.restart(true);
|
||||
}
|
||||
else {
|
||||
app.exit(true);
|
||||
app.exit(false, true);
|
||||
}
|
||||
}
|
||||
}).notify(project);
|
||||
|
||||
+9
-9
@@ -767,12 +767,12 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
|
||||
|
||||
@Override
|
||||
public void exit() {
|
||||
exit(false);
|
||||
exit(false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exit(final boolean force) {
|
||||
exit(force, true, false);
|
||||
public void exit(boolean force, final boolean exitConfirmed) {
|
||||
exit(false, exitConfirmed, true, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -781,8 +781,8 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restart(boolean force) {
|
||||
exit(force, true, true);
|
||||
public void restart(boolean exitConfirmed) {
|
||||
exit(false, exitConfirmed, true, true);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -796,7 +796,7 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
|
||||
*/
|
||||
private static volatile boolean exiting = false;
|
||||
|
||||
public void exit(final boolean force, final boolean allowListenersToCancel, final boolean restart) {
|
||||
public void exit(final boolean force, final boolean exitConfirmed, final boolean allowListenersToCancel, final boolean restart) {
|
||||
if (exiting) return;
|
||||
|
||||
exiting = true;
|
||||
@@ -808,7 +808,7 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
|
||||
Runnable runnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!confirmExitIfNeeded(force)) {
|
||||
if (!force && !confirmExitIfNeeded(exitConfirmed)) {
|
||||
saveAll();
|
||||
return;
|
||||
}
|
||||
@@ -857,9 +857,9 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
|
||||
return true;
|
||||
}
|
||||
|
||||
private static boolean confirmExitIfNeeded(boolean force) {
|
||||
private static boolean confirmExitIfNeeded(boolean exitConfirmed) {
|
||||
final boolean hasUnsafeBgTasks = ProgressManager.getInstance().hasUnsafeProgressIndicator();
|
||||
if (force && !hasUnsafeBgTasks) {
|
||||
if (exitConfirmed && !hasUnsafeBgTasks) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user