From 7fad220e8962be4817b9af2ca70442b01ce0967a Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 23 Feb 2010 08:04:42 +0000 Subject: [PATCH] Added javadoc for CloseListener svn changeset:11474/svn branch:6.2 --- src/com/vaadin/ui/Window.java | 43 +++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java index 63daabdf90..b9a6bd7227 100644 --- a/src/com/vaadin/ui/Window.java +++ b/src/com/vaadin/ui/Window.java @@ -1053,25 +1053,60 @@ 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. + * + *

+ * Note that removing windows using {@link #removeWindow(Window)} will not + * fire the CloseListener. + *

+ */ 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. + * + *

+ * Note that removing windows using {@link #removeWindow(Window)} will not + * fire the CloseListener. + *

* * @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. + * + *

+ * For more information on CloseListeners see {@link CloseListener}. + *

* * @param listener - * the listener to remove. + * the CloseListener to remove. */ public void removeListener(CloseListener listener) { addListener(CloseEvent.class, listener, WINDOW_CLOSE_METHOD); -- 2.39.5