edu.rice.cs.drjava.ui
Class DrJavaErrorHandler

java.lang.Object
  extended by edu.rice.cs.drjava.ui.DrJavaErrorHandler

public class DrJavaErrorHandler
extends Object

The handle() method in this class is called everytime an uncaught exception propagates to an AWT action. The static log() method can be used to put log entries into the error log but continue execution. This does not automatically update the "DrJava Errors" window when new errors occur. In the case of errors, we want to minimize the effects on the GUI. If we want to see an updated dialog, we can click on the "DrJava Errors" button again.

Version:
$Id: DrJavaErrorHandler.java 4691 2008-12-02 23:33:27Z dlsmith $

Nested Class Summary
static class DrJavaErrorHandler.LoggedCondition
          The throwable used for logging unexpected situations.
 
Field Summary
static Log LOG
          Log to file.
 
Constructor Summary
DrJavaErrorHandler()
           
 
Method Summary
static void clearErrors()
          Clears the list of errors.
static JButton getButton()
          Gets the button to show.
static Throwable getError(int index)
          Returns the error with the given index.
static int getErrorCount()
          Returns the size of the error list.
 void handle(Throwable thrown)
          Handles an uncaught exception.
static void log(String message)
          Log an unexpected situation.
static void record(Throwable thrown)
          Record the throwable in the errors list.
static void setButton(JButton b)
          Sets the button to show.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final Log LOG
Log to file.

Constructor Detail

DrJavaErrorHandler

public DrJavaErrorHandler()
Method Detail

setButton

public static void setButton(JButton b)
Sets the button to show.


getButton

public static JButton getButton()
Gets the button to show.


getErrorCount

public static int getErrorCount()
Returns the size of the error list.


getError

public static Throwable getError(int index)
Returns the error with the given index.


clearErrors

public static void clearErrors()
Clears the list of errors.


handle

public void handle(Throwable thrown)
Handles an uncaught exception. This gets called automatically by AWT.


record

public static void record(Throwable thrown)
Record the throwable in the errors list.


log

public static void log(String message)
Log an unexpected situation.