From 9e144e51148ccf7f6379ad30d76e711fcfdfe6de Mon Sep 17 00:00:00 2001 From: Joonas Lehtinen Date: Wed, 3 Sep 2008 17:52:52 +0000 Subject: [PATCH] Changed window close behavior to not disable browser-level windows when closing them. This does not affect the past behavior as the close has not been working before #2053. svn changeset:5353/svn branch:trunk --- src/com/itmill/toolkit/ui/Window.java | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/com/itmill/toolkit/ui/Window.java b/src/com/itmill/toolkit/ui/Window.java index e8201d4fdf..f1c5346e96 100644 --- a/src/com/itmill/toolkit/ui/Window.java +++ b/src/com/itmill/toolkit/ui/Window.java @@ -841,10 +841,22 @@ public class Window extends Panel implements URIHandler, ParameterHandler { } /** - * Method that handles window closing (from UI). If one wants to have window - * that cannot be closed (with server side check), override this with and - * empty method. Main window of the application can not be closed (on the - * server-side). + * Method that handles window closing (from UI). + * + *

+ * By default, sub-windows are removed from their respective parent windows + * and thus visually closed on browser-side. Browser-level windows also + * closed on the client-side, but they are not implicitly removed from the + * application. + *

+ * + *

+ * If one wants change the default behavior, register a window close + * listenter and do something else. For example, you could re-open the + * browser-level window with mainWindow.open(), re-add the removed + * sub-window back to its parent or remove browser-level window + * automatically from the application. + *

*/ protected void close() { if (getApplication() != null @@ -853,7 +865,6 @@ public class Window extends Panel implements URIHandler, ParameterHandler { } Window parent = (Window) getParent(); if (parent == null) { - setVisible(false); fireClose(); } else { // subwindow is removed from parent -- 2.39.5