- java.lang.Object
-
- util.exc.ErrorHandler
-
public class ErrorHandler extends java.lang.Object
This error handler should be used to show exceptions (like IOExceptions) to the user. It provides showing a localized message, that says something to the user, having the option to get extra information like the stack trace and nested exceptions. The error is logged, too.- Author:
- Til Schneider, www.murfman.de
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static javax.swing.Icon
ERROR_ICON
The icon to use for error messages.(package private) static Localizer
LOCALIZER
The localizer of this class.(package private) static javax.swing.JFrame
mParent
The parent frame to use for error messages.static int
NO_PRESSED
No was pressedstatic int
OK_PRESSED
OK was pressedstatic int
SHOW_OK
Show only a OK-Buttonstatic int
SHOW_YES_NO
Show only a Yes/No-Buttonstatic int
YES_PRESSED
Yes was pressed
-
Constructor Summary
Constructors Constructor Description ErrorHandler()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
handle(java.lang.String msg, java.lang.Throwable throwable)
Handles a Throwable (Shows and logs it).static int
handle(java.lang.String msg, java.lang.Throwable thr, int messageType)
Handles a Throwable (Shows and logs it).static void
handle(TvBrowserException tvExc)
Handles a TvBrowserException (Shows and logs it).static void
setFrame(javax.swing.JFrame parentFrame)
Sets the parent frame to use for error messages.
-
-
-
Field Detail
-
SHOW_OK
public static final int SHOW_OK
Show only a OK-Button- See Also:
- Constant Field Values
-
SHOW_YES_NO
public static final int SHOW_YES_NO
Show only a Yes/No-Button- See Also:
- Constant Field Values
-
OK_PRESSED
public static final int OK_PRESSED
OK was pressed- See Also:
- Constant Field Values
-
YES_PRESSED
public static final int YES_PRESSED
Yes was pressed- See Also:
- Constant Field Values
-
NO_PRESSED
public static final int NO_PRESSED
No was pressed- See Also:
- Constant Field Values
-
LOCALIZER
static final Localizer LOCALIZER
The localizer of this class.
-
ERROR_ICON
static final javax.swing.Icon ERROR_ICON
The icon to use for error messages.
-
mParent
static javax.swing.JFrame mParent
The parent frame to use for error messages.
-
-
Method Detail
-
setFrame
public static void setFrame(javax.swing.JFrame parentFrame)
Sets the parent frame to use for error messages.- Parameters:
parentFrame
- the parent frame to use for error messages.
-
handle
public static void handle(TvBrowserException tvExc)
Handles a TvBrowserException (Shows and logs it).- Parameters:
tvExc
- The exception to handle.
-
handle
public static void handle(java.lang.String msg, java.lang.Throwable throwable)
Handles a Throwable (Shows and logs it).- Parameters:
msg
- The localized error message to show to the user.throwable
- The exception to handle.
-
handle
public static int handle(java.lang.String msg, java.lang.Throwable thr, int messageType)
Handles a Throwable (Shows and logs it).- Parameters:
msg
- The localized error message to show to the user.thr
- The exception to handle.messageType
- The type of Window to Display:OK- Returns:
- Value of Button that was pressed: ErrorHandler.YES_PRESSED, ErrorHandler.NO_PRESSED, ErrorHandler.OK_PRESSED
- Since:
- 2.1
-
-