Adds a CloseListener to the window. For a 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. Also note that Opera does not send events like all other browsers and therefore the close listener might not be called if Opera is used.
Since Vaadin 6.5, removing windows using {@link #removeWindow(Window)}does fire the CloseListener.
@param listener the CloseListener to add.