csheets.ui
Class WindowClosingHandler

java.lang.Object
  extended by java.awt.event.WindowAdapter
      extended by csheets.ui.WindowClosingHandler
All Implemented Interfaces:
WindowFocusListener, WindowListener, WindowStateListener, EventListener

public class WindowClosingHandler
extends WindowAdapter

A window adapter that invokes an action on window closing.

Author:
Einar Pehrson

Constructor Summary
WindowClosingHandler(Window window, Action action)
          Creates a new window closing handler
 
Method Summary
 void windowClosing(WindowEvent e)
          Invokes exit() on the UI controller when a window closing event is received.
 
Methods inherited from class java.awt.event.WindowAdapter
windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened, windowStateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowClosingHandler

public WindowClosingHandler(Window window,
                            Action action)
Creates a new window closing handler

Parameters:
window - the window to listen to
action - the action to invoke on window closing
Method Detail

windowClosing

public void windowClosing(WindowEvent e)
Invokes exit() on the UI controller when a window closing event is received.

Specified by:
windowClosing in interface WindowListener
Overrides:
windowClosing in class WindowAdapter
Parameters:
e - the event that was fied