mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Added AppLifecycleListener.appWilExit API
This commit is contained in:
@@ -55,6 +55,11 @@ public interface AppLifecycleListener {
|
||||
*/
|
||||
void appClosing();
|
||||
|
||||
/**
|
||||
* Fired after all exit checks and after saving the settings. At this point the app is guaranteed to exit.
|
||||
*/
|
||||
default void appWillExit() { }
|
||||
|
||||
abstract class Adapter implements AppLifecycleListener {
|
||||
@Override
|
||||
public void appFrameCreated(String[] commandLineArgs, @NotNull Ref<Boolean> willOpenProject) { }
|
||||
|
||||
+3
-1
@@ -758,7 +758,8 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
|
||||
return;
|
||||
}
|
||||
|
||||
getMessageBus().syncPublisher(AppLifecycleListener.TOPIC).appClosing();
|
||||
final AppLifecycleListener publisher = getMessageBus().syncPublisher(AppLifecycleListener.TOPIC);
|
||||
publisher.appClosing();
|
||||
|
||||
myDisposeInProgress = true;
|
||||
|
||||
@@ -768,6 +769,7 @@ public class ApplicationImpl extends PlatformComponentManagerImpl implements App
|
||||
|
||||
saveSettings();
|
||||
|
||||
publisher.appWillExit();
|
||||
|
||||
boolean success = disposeSelf(!force);
|
||||
if (!success || isUnitTestMode() || Boolean.getBoolean("idea.test.guimode")) {
|
||||
|
||||
Reference in New Issue
Block a user