|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.common.util.Reporter
public final class Reporter
This package looks after Exceptions and messages as they happen. It would be nice not to need this class - the principle being that any library that encounters an error can throw an exception to indicate that there is a problem. However this is not always the case. For example:
for license details.
The copyright to this program is held by it's authors.
Nested Class Summary | |
---|---|
static class |
Reporter.CustomAWTExceptionHandler
A class to handle AWT caught Exceptions |
Field Summary | |
---|---|
private static String |
AWT_HANDLER_PROPERTY
The system property name for registering AWT exceptions |
private static EventListenerList |
LISTENERS
The list of listeners |
private static Logger |
log
The log stream |
private static String |
OUR_NAME
The name of the class to register for AWT exceptions |
Constructor Summary | |
---|---|
private |
Reporter()
Enforce Singleton |
Method Summary | |
---|---|
static void |
addReporterListener(ReporterListener li)
Add an Exception listener to the list of things wanting to know whenever we capture an Exception |
protected static void |
fireCapture(ReporterEvent ev)
Log a message. |
static void |
grabAWTExecptions(boolean grab)
Sets the parent of any exception windows. |
static void |
informUser(Object source,
LucidException prob)
Something has gone wrong. |
static void |
informUser(Object source,
LucidRuntimeException prob)
Something has gone wrong. |
static void |
informUser(Object source,
MsgBase message)
Something has happened. |
static void |
informUser(Object source,
MsgBase message,
Object param)
Something has happened. |
static void |
informUser(Object source,
MsgBase message,
Object[] params)
Something has happened. |
static void |
informUser(Object source,
String message)
Deprecated. Use informUser(Object source, MsgBase message) instead |
static void |
informUser(Object source,
Throwable prob)
Something has gone wrong. |
static void |
removeReporterListener(ReporterListener li)
Remove an Exception listener from the list of things wanting to know whenever we capture an Exception |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String AWT_HANDLER_PROPERTY
private static final String OUR_NAME
private static final Logger log
private static final EventListenerList LISTENERS
Constructor Detail |
---|
private Reporter()
Method Detail |
---|
public static void informUser(Object source, Throwable prob)
source
- The cause of the problem, a Component if possible.prob
- The Exception that was thrown
TODO(joe): think about this - isn't this method useful?
deprecated use either informUser(Object source, LucidException prob)
or informUser(Object source, LucidRuntimeException prob)public static void informUser(Object source, LucidException prob)
source
- The cause of the problem, a Component if possible.prob
- The Exception that was thrownpublic static void informUser(Object source, LucidRuntimeException prob)
source
- The cause of the problem, a Component if possible.prob
- The Exception that was thrownpublic static void informUser(Object source, String message)
source
- The cause of the message, a Component if possible.message
- The message to pass to the userpublic static void informUser(Object source, MsgBase message)
Maybe we should have an extra parameter (or even several versions of this method like log*()) that describes the severity of the message. A Sw*ng listener could use this to decide the icon in the OptionPane for example.
source
- The cause of the message, a Component if possible.message
- The message to pass to the userpublic static void informUser(Object source, MsgBase message, Object param)
Maybe we should have an extra parameter (or even several versions of this method like log*()) that describes the severity of the message. A Sw*ng listener could use this to decide the icon in the OptionPane for example.
source
- The cause of the message, a Component if possible.message
- The message to pass to the userparam
- The parameters to the messagepublic static void informUser(Object source, MsgBase message, Object[] params)
Maybe we should have an extra parameter (or even several versions of this method like log*()) that describes the severity of the message. A Sw*ng listener could use this to decide the icon in the OptionPane for example.
source
- The cause of the message, a Component if possible.message
- The message to pass to the userparams
- The parameters to the messagepublic static void addReporterListener(ReporterListener li)
public static void removeReporterListener(ReporterListener li)
protected static void fireCapture(ReporterEvent ev)
public static void grabAWTExecptions(boolean grab)
|
Copyright ยจ 2003-2007 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |