diff options
author | Artur Signell <artur.signell@itmill.com> | 2010-02-23 10:17:00 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2010-02-23 10:17:00 +0000 |
commit | d3d39ab75f25555ed1c58d6fe727d1d25d489a61 (patch) | |
tree | 166d5d26f182b45aa5f00f674e2466302aa27362 /src/com/vaadin/ui/Window.java | |
parent | 73ecd7f2a42e09868e4fd9c91073867c809836a2 (diff) | |
download | vaadin-framework-d3d39ab75f25555ed1c58d6fe727d1d25d489a61.tar.gz vaadin-framework-d3d39ab75f25555ed1c58d6fe727d1d25d489a61.zip |
Merged [11391],[11473],[11474],[11475],[11477] from 6.2
Fix and test case for #4222
svn changeset:11485/svn branch:6.3
Diffstat (limited to 'src/com/vaadin/ui/Window.java')
-rw-r--r-- | src/com/vaadin/ui/Window.java | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java index 63daabdf90..f4657d81f6 100644 --- a/src/com/vaadin/ui/Window.java +++ b/src/com/vaadin/ui/Window.java @@ -1053,28 +1053,63 @@ public class Window extends Panel implements URIHandler, ParameterHandler { } } + /** + * An interface used for listening to Window close events. Add the + * CloseListener to a browser level window or a sub window and + * {@link CloseListener#windowClose(CloseEvent)} will be called whenever the + * user closes the window. + * + * <p> + * Note that removing windows using {@link #removeWindow(Window)} will not + * fire the CloseListener. + * </p> + */ public interface CloseListener extends Serializable { + /** + * Called when the user closes a window. Use + * {@link CloseEvent#getWindow()} to get a reference to the + * {@link Window} that was closed. + * + * @param e + * Event containing + */ public void windowClose(CloseEvent e); } /** - * Adds the listener. + * Adds a CloseListener to the window. + * + * For a sub window the CloseListener is fired when the user closes it + * (clicks on the close button). + * + * For a browser level window the CloseListener is fired when the browser + * level window is closed. Note that closing a browser level window does not + * mean it will be destroyed. + * + * <p> + * Note that removing windows using {@link #removeWindow(Window)} will not + * fire the CloseListener. + * </p> * * @param listener - * the listener to add. + * the CloseListener to add. */ public void addListener(CloseListener listener) { addListener(CloseEvent.class, listener, WINDOW_CLOSE_METHOD); } /** - * Removes the listener. + * Removes the CloseListener from the window. + * + * <p> + * For more information on CloseListeners see {@link CloseListener}. + * </p> * * @param listener - * the listener to remove. + * the CloseListener to remove. */ public void removeListener(CloseListener listener) { - addListener(CloseEvent.class, listener, WINDOW_CLOSE_METHOD); + removeListener(CloseEvent.class, listener, WINDOW_CLOSE_METHOD); } protected void fireClose() { |