|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ptolemy.gui.MessageHandler
This is a class that is used to report errors. It provides a set of static methods that are called to report errors. However, the actual reporting of the errors is deferred to an instance of this class that is set using the setMessageHandler() method. Normally there is only one instance, set up by the application, so the class is a singleton. But this is not enforced.
This base class simply writes the errors to System.err. When an applet or application starts up, it may wish to set a subclass of this class as the message handler, to allow a nicer way of reporting errors. For example, a swing application will probably want to report errors in a dialog box, using for example the derived class GraphicalMessageHandler.
GraphicalMessageHandler
Constructor Summary | |
MessageHandler()
|
Method Summary | |
protected void |
_error(java.lang.String info)
Show the specified error message. |
protected void |
_error(java.lang.String info,
java.lang.Exception exception)
Show the specified message and exception information. |
protected void |
_message(java.lang.String info)
Show the specified message. |
protected void |
_warning(java.lang.String info)
Show the specified message in a modal dialog. |
protected void |
_warning(java.lang.String info,
java.lang.Exception exception)
Show the specified message and exception information in a modal dialog. |
static void |
error(java.lang.String info)
Defer to the set message handler to show the specified error message. |
static void |
error(java.lang.String info,
java.lang.Exception exception)
Defer to the set message handler to show the specified message and exception information. |
static MessageHandler |
getMessageHandler()
Return the message handler instance that is used by the static methods in this class. |
static void |
message(java.lang.String info)
Defer to the set message handler to show the specified message. |
static void |
setMessageHandler(MessageHandler handler)
Set the message handler instance that is used by the static methods in this class. |
static void |
warning(java.lang.String info)
Defer to the set message handler to show the specified message in a modal dialog. |
static void |
warning(java.lang.String info,
java.lang.Exception exception)
Show the specified message and exception information in a modal dialog. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MessageHandler()
Method Detail |
public static void error(java.lang.String info)
info
- The message.public static void error(java.lang.String info, java.lang.Exception exception)
info
- The message.exception
- The exception.CancelException
public static MessageHandler getMessageHandler()
public static void message(java.lang.String info)
info
- The message.public static void setMessageHandler(MessageHandler handler)
handler
- The message handler.public static void warning(java.lang.String info) throws CancelException
info
- The message.CancelException
- If the user clicks on the "Cancel" button.public static void warning(java.lang.String info, java.lang.Exception exception) throws CancelException
info
- The message.CancelException
- If the user clicks on the "Cancel" button.protected void _error(java.lang.String info)
info
- The message.protected void _error(java.lang.String info, java.lang.Exception exception)
info
- The message.exception
- The exception.CancelException
protected void _message(java.lang.String info)
info
- The message.protected void _warning(java.lang.String info) throws CancelException
info
- The message.CancelException
- If the user clicks on the "Cancel" button.protected void _warning(java.lang.String info, java.lang.Exception exception) throws CancelException
info
- The message.CancelException
- If the user clicks on the "Cancel" button.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |