abbot.util
Class EDTExceptionCatcher

java.lang.Object
  extended by abbot.util.EventDispatchExceptionHandler
      extended by abbot.util.EDTExceptionCatcher

public class EDTExceptionCatcher
extends EventDispatchExceptionHandler

Provide access to the most recent exception caught on the event dispatch thread.


Field Summary
 
Fields inherited from class abbot.util.EventDispatchExceptionHandler
PROP_NAME
 
Constructor Summary
EDTExceptionCatcher()
           
 
Method Summary
static void clear()
           
protected  void exceptionCaught(Throwable thr)
          Define this to handle the exception as needed.
static Throwable getThrowable()
          Return the most recent exception caught on the dispatch thread, or null if none has been thrown or the exception has been cleared.
static long getThrowableTime()
          Returns when the most recent exception was caught on the dispatch thread, or -1 if none has been thrown or the exception has been cleared.
 void install()
          Install a handler for event dispatch exceptions.
 
Methods inherited from class abbot.util.EventDispatchExceptionHandler
handle, isInstalled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EDTExceptionCatcher

public EDTExceptionCatcher()
Method Detail

install

public void install()
Description copied from class: EventDispatchExceptionHandler
Install a handler for event dispatch exceptions. This is kind of a hack, but it's Sun's hack. See the javadoc for java.awt.EventDispatchThread for details. NOTE: we throw an exception immediately, which ensures that our handler is installed, since otherwise someone might set this property later. java.awt.EventDispatchThread doesn't actually load the handler specified by the property until an exception is caught by the event dispatch thread. SwingSet2 in 1.4.1 installs its own. Note that a new instance is created for each exception thrown.

Overrides:
install in class EventDispatchExceptionHandler

getThrowable

public static Throwable getThrowable()
Return the most recent exception caught on the dispatch thread, or null if none has been thrown or the exception has been cleared. Also clears the exception.


getThrowableTime

public static long getThrowableTime()
Returns when the most recent exception was caught on the dispatch thread, or -1 if none has been thrown or the exception has been cleared.


clear

public static void clear()

exceptionCaught

protected void exceptionCaught(Throwable thr)
Description copied from class: EventDispatchExceptionHandler
Define this to handle the exception as needed. Default prints a warning to System.err.

Overrides:
exceptionCaught in class EventDispatchExceptionHandler


Copyright © 2002-2008 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge