diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2008-02-01 13:13:51 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2008-02-01 13:13:51 +0000 |
commit | fbb08908180a688b1c692493d7dff62f7b0ade66 (patch) | |
tree | ac9d4f55325dec21b994d6faedb3a21357d94697 /src/com/itmill/toolkit/ui | |
parent | 3cce6ee15bf75db2a6ba90934100a25bcca040ff (diff) | |
download | vaadin-framework-fbb08908180a688b1c692493d7dff62f7b0ade66.tar.gz vaadin-framework-fbb08908180a688b1c692493d7dff62f7b0ade66.zip |
fixes #1036 and removes some obsolete code
svn changeset:3704/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/ui')
-rw-r--r-- | src/com/itmill/toolkit/ui/Window.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/itmill/toolkit/ui/Window.java b/src/com/itmill/toolkit/ui/Window.java index 92ed8db5ad..2eca2e0a40 100644 --- a/src/com/itmill/toolkit/ui/Window.java +++ b/src/com/itmill/toolkit/ui/Window.java @@ -124,7 +124,7 @@ public class Window extends Panel implements URIHandler, ParameterHandler { private LinkedList notifications; - private boolean modal; + private boolean modal = false; /* ********************************************************************* */ @@ -871,8 +871,24 @@ public class Window extends Panel implements URIHandler, ParameterHandler { // Closing final Boolean close = (Boolean) variables.get("close"); if (close != null && close.booleanValue()) { + close(); + } + } + + /** + * 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. + */ + protected void close() { + Window parent = (Window) getParent(); + if (parent == null) { setVisible(false); fireClose(); + } else { + // subwindow is removed from parent + parent.removeWindow(this); + fireClose(); } } |