com.lc.util.awt
Class DispatchThreadThrowableManager

java.lang.Object
  |
  +--java.awt.EventQueue
        |
        +--com.lc.util.awt.DispatchThreadThrowableManager
All Implemented Interfaces:
IThrowableHandler

public class DispatchThreadThrowableManager
extends java.awt.EventQueue
implements IThrowableHandler

Base class for handling Throwables from inside the Dispatch Thread.

This class was inspired from de.qfs.lib.gui.EventQueue.

Version:
$Revision: 1.1.1.1 $ $Date: 2002/02/19 22:12:05 $
Author:
Laurent Caillette

Constructor Summary
DispatchThreadThrowableManager()
          Auto-installing constructor.
DispatchThreadThrowableManager(boolean shouldInstall)
          Non auto-installing constructor.
DispatchThreadThrowableManager(IThrowableHandler delegate, boolean shouldInstall)
          Creates an instance delegating Throwable handling.
 
Method Summary
 void dispatchEvent(java.awt.AWTEvent event)
          Overrides dispatchEvent method from java.awt.EventQueue in order to manage the Throwable caught.
 boolean handleThrowable(java.lang.Throwable throwable)
          Default implementation, delegates to the delegate if it is not null, or does nothing by returning false.
 void setUninstallOnThrowableHandling(boolean uninstall)
           
 void uninstall()
          Pops current instance up from EventQueue stack.
 
Methods inherited from class java.awt.EventQueue
getNextEvent, invokeAndWait, invokeLater, isDispatchThread, peekEvent, peekEvent, pop, postEvent, push
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DispatchThreadThrowableManager

public DispatchThreadThrowableManager()
Auto-installing constructor.

DispatchThreadThrowableManager

public DispatchThreadThrowableManager(boolean shouldInstall)
Non auto-installing constructor.
Parameters:
shouldInstall - true if created instance should be installed.

DispatchThreadThrowableManager

public DispatchThreadThrowableManager(IThrowableHandler delegate,
                                      boolean shouldInstall)
Creates an instance delegating Throwable handling.
Parameters:
delegate - The IThrowableHandler to delegate to.
Method Detail

handleThrowable

public boolean handleThrowable(java.lang.Throwable throwable)
Default implementation, delegates to the delegate if it is not null, or does nothing by returning false.
Specified by:
handleThrowable in interface IThrowableHandler
Following copied from interface: com.lc.util.IThrowableHandler
Parameters:
throwable - The Throwable to handle.
Returns:
true if it was handled, false if default behavior should be used instead.

setUninstallOnThrowableHandling

public void setUninstallOnThrowableHandling(boolean uninstall)

uninstall

public void uninstall()
Pops current instance up from EventQueue stack.
Throws:
ApplicationError - if not installed.

dispatchEvent

public final void dispatchEvent(java.awt.AWTEvent event)
Overrides dispatchEvent method from java.awt.EventQueue in order to manage the Throwable caught.

This method implicitly calls uninstall under following conditions :