mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-02 19:27:57 +08:00
WindowManager checkModificationsAndCloseAll does not support Window.Committable #854
This commit is contained in:
parent
efb033b531
commit
264edb8f6f
@ -1878,7 +1878,7 @@ public class DesktopWindowManager extends WindowManager {
|
||||
addShortcuts(window, openType);
|
||||
}
|
||||
|
||||
public void checkModificationsAndCloseAll(final Runnable runIfOk, final @Nullable Runnable runIfCancel) {
|
||||
public void checkModificationsAndCloseAll(Runnable runIfOk, @Nullable Runnable runIfCancel) {
|
||||
boolean modified = false;
|
||||
for (Window window : getOpenWindows()) {
|
||||
if (!disableSavingScreenHistory) {
|
||||
@ -1896,7 +1896,12 @@ public class DesktopWindowManager extends WindowManager {
|
||||
recursiveFramesClose = false;
|
||||
}
|
||||
|
||||
if (window.getDsContext() != null && window.getDsContext().isModified()) {
|
||||
if (window instanceof WrappedWindow
|
||||
&& ((WrappedWindow) window).getWrapper() instanceof Window.Committable) {
|
||||
WrappedWindow wrappedWindow = (WrappedWindow) window;
|
||||
modified = ((Window.Committable) wrappedWindow.getWrapper()).isModified();
|
||||
} else if (window.getDsContext() != null
|
||||
&& window.getDsContext().isModified()) {
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
|
@ -898,7 +898,7 @@ public class WebWindowManager extends WindowManager {
|
||||
* @param runIfOk a closure to run after all screens are closed
|
||||
* @param runIfCancel a closure to run if there were modifications and a user canceled the operation
|
||||
*/
|
||||
public void checkModificationsAndCloseAll(final Runnable runIfOk, final @Nullable Runnable runIfCancel) {
|
||||
public void checkModificationsAndCloseAll(Runnable runIfOk, @Nullable Runnable runIfCancel) {
|
||||
boolean modified = false;
|
||||
for (Window window : getOpenWindows()) {
|
||||
if (!disableSavingScreenHistory) {
|
||||
@ -911,7 +911,12 @@ public class WebWindowManager extends WindowManager {
|
||||
window.saveSettings();
|
||||
}
|
||||
|
||||
if (window.getDsContext() != null && window.getDsContext().isModified()) {
|
||||
if (window instanceof WrappedWindow
|
||||
&& ((WrappedWindow) window).getWrapper() instanceof Window.Committable) {
|
||||
WrappedWindow wrappedWindow = (WrappedWindow) window;
|
||||
modified = ((Window.Committable) wrappedWindow.getWrapper()).isModified();
|
||||
} else if (window.getDsContext() != null
|
||||
&& window.getDsContext().isModified()) {
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user