jautil.platform
Class MacOSXQuitHandler

java.lang.Object
  extended by com.apple.eawt.ApplicationAdapter
      extended by jautil.platform.MacOSXQuitHandler
All Implemented Interfaces:
com.apple.eawt.ApplicationListener, java.util.EventListener

public final class MacOSXQuitHandler
extends com.apple.eawt.ApplicationAdapter

Hooks a Mac OS X Quit event to the Java app's quit sequence. Based on the Apple DTS MacOSXAdapter example.


Method Summary
 void handleQuit(com.apple.eawt.ApplicationEvent appevt)
          Accepts the Mac OS X Quit application-event, setting its "handled" status to false and calling the registered Java quitter.
static void registerMacOSXQuitter(java.lang.Runnable quitter)
          Singleton factory method, registering the given quitter for this JVM, assuming there has been no previous registration.
 
Methods inherited from class com.apple.eawt.ApplicationAdapter
handleAbout, handleOpenApplication, handleOpenFile, handlePreferences, handlePrintFile, handleReOpenApplication
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

handleQuit

public void handleQuit(com.apple.eawt.ApplicationEvent appevt)
Accepts the Mac OS X Quit application-event, setting its "handled" status to false and calling the registered Java quitter.

Specified by:
handleQuit in interface com.apple.eawt.ApplicationListener
Overrides:
handleQuit in class com.apple.eawt.ApplicationAdapter

registerMacOSXQuitter

public static void registerMacOSXQuitter(java.lang.Runnable quitter)
Singleton factory method, registering the given quitter for this JVM, assuming there has been no previous registration.