|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bushe.swing.exception.AWTExceptionHandler
public class AWTExceptionHandler
Plug this class into the AWT Thread to handle Swing Exceptions. To plug in the exception handler, add it as a JVM property like so:
java -Dsun.awt.exception.handler=org.bushe.swing.exception.AWTExceptionHandlerWhen this property is set, this class is instantiated and called by the EDT to when exceptions occur in the AWT Thread This class is hopefully customizable enough for most any application.
EventDispatchThread.handleException(Throwable)
Nested Class Summary | |
---|---|
static interface |
AWTExceptionHandler.AWTErrorLogger
An implementation of this interface can be passed to the AWTExcpetionHandler to handle logging on behalf of the AWTExceptionHandler. |
Constructor Summary | |
---|---|
AWTExceptionHandler()
|
Method Summary | |
---|---|
protected javax.swing.JDialog |
createErrorDialog(java.awt.Frame f,
java.lang.Throwable t)
Creates an ErrorDialog. |
static java.lang.String |
getErrorEmailAddress()
This returns null by default and if it returns null, no Email button is shown in the error dialog. |
protected java.awt.Frame |
getFrameForMessageDialog()
Finds the frame for hte error message. |
void |
handle(java.lang.Throwable t)
Called by the AWT EventQueue to handle the exception |
protected void |
handleThrowableWithFrame(java.awt.Frame f,
java.lang.Throwable t)
This method is called when there is a frame. |
protected void |
handleThrowableWithoutFrame(java.lang.Throwable t)
This method is called when there is no frame. |
protected void |
logError(java.lang.Throwable t)
Logs the error the current implementation of the Logger. |
static void |
setErrorEmailAddress(java.lang.String emailAddy)
If set to a non-null value, the Email button will be shown in the error dialog that will trigger the user's email client to send an error email to the error email address. |
static void |
setLogger(AWTExceptionHandler.AWTErrorLogger logger)
By default the handler logs errors to system.err. |
static java.lang.String |
stackTraceToString(java.lang.Throwable t)
Given a throwable, it returns the stack trace as a string |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AWTExceptionHandler()
Method Detail |
---|
public static java.lang.String getErrorEmailAddress()
public static void setErrorEmailAddress(java.lang.String emailAddy)
emailAddy
- current email address that the Email button on the error dialog will send to.public static void setLogger(AWTExceptionHandler.AWTErrorLogger logger)
public void handle(java.lang.Throwable t)
t
- the throwable to handleprotected void handleThrowableWithoutFrame(java.lang.Throwable t)
t
- protected void handleThrowableWithFrame(java.awt.Frame f, java.lang.Throwable t)
t
- the throwable to handleprotected void logError(java.lang.Throwable t)
t
- the throwable to log.protected javax.swing.JDialog createErrorDialog(java.awt.Frame f, java.lang.Throwable t)
f
- the owning frame from getFrameForMessageDialog()t
- the throwable to display
protected java.awt.Frame getFrameForMessageDialog()
public static java.lang.String stackTraceToString(java.lang.Throwable t)
t
- the throwable to processes
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |