本文整理汇总了Java中org.jdesktop.swingx.JXErrorPane.setErrorReporter方法的典型用法代码示例。如果您正苦于以下问题:Java JXErrorPane.setErrorReporter方法的具体用法?Java JXErrorPane.setErrorReporter怎么用?Java JXErrorPane.setErrorReporter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.swingx.JXErrorPane
的用法示例。
在下文中一共展示了JXErrorPane.setErrorReporter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showErrorDialog
import org.jdesktop.swingx.JXErrorPane; //导入方法依赖的package包/类
public static void showErrorDialog(Component parent, ErrorInfo errorInfo)
{
if (parent == null)
{
if (org.springframework.richclient.application.Application.isLoaded())
{
ApplicationWindow activeWindow = org.springframework.richclient.application.Application
.instance().getActiveWindow();
if (activeWindow != null)
parent = activeWindow.getControl();
}
}
JXErrorPane pane = new JXErrorPane();
pane.setErrorInfo(errorInfo);
pane.setErrorReporter(new JdicEmailNotifierErrorReporter());
JXErrorPane.showDialog(parent, pane);
}
示例2: onEvent
import org.jdesktop.swingx.JXErrorPane; //导入方法依赖的package包/类
/**
*
* @param topic
* @param data
*/
public void onEvent(String topic, Exception data) {
String msg = randomHaiku();
String details = formatStackTraceForDialogs(data, false);
/*
* Create an error pane to display the error stuff
*/
JXErrorPane errorPane = new JXErrorPane();
Icon errorIcon = randomImage();
ErrorInfo errorInfo = new ErrorInfo("VARS - Fatal Error", msg, details, null, data, ErrorLevel.FATAL, null);
errorPane.setIcon(errorIcon);
errorPane.setErrorInfo(errorInfo);
errorPane.setErrorReporter(new EmailErrorReporter(errorPane));
JXErrorPane.showDialog(null, errorPane);
}
示例3: notifyUserAboutException
import org.jdesktop.swingx.JXErrorPane; //导入方法依赖的package包/类
/**
* Shows the {@link JXErrorPane} to the user.
*/
public void notifyUserAboutException(Thread thread, Throwable throwable) {
ErrorInfo errorInfo = new ErrorInfo(
resolveExceptionCaption(throwable),
(String) createExceptionContent(throwable),
getDetailsAsHTML(throwable.getMessage(), logLevel, throwable),
null, throwable, logLevel.getJdkLogLevel(), null);
JXErrorPane pane = new JXErrorPane();
pane.setErrorInfo(errorInfo);
if (errorReporter != null) {
pane.setErrorReporter(errorReporter);
}
JXErrorPane.showDialog(resolveParentFrame(), pane);
}
示例4: onEvent
import org.jdesktop.swingx.JXErrorPane; //导入方法依赖的package包/类
/**
*
* @param topic
* @param error
*/
public void onEvent(String topic, Object error) {
String msg = "An error occurred. Refer to the details for more information.";
String details = null;
Throwable data = null;
if (error instanceof Throwable) {
data = (Throwable) error;
details = formatStackTraceForDialogs(data, true);
}
else {
details = error.toString();
}
/*
* Create an error pane to display the error stuff
*/
JXErrorPane errorPane = new JXErrorPane();
Icon errorIcon = randomImage();
ErrorInfo errorInfo = new ErrorInfo("VARS - Something exceptional occurred (and we don't like that)", msg,
details, null, data, ErrorLevel.WARNING, null);
errorPane.setIcon(errorIcon);
errorPane.setErrorInfo(errorInfo);
errorPane.setErrorReporter(new EmailErrorReporter(errorPane));
JXErrorPane.showDialog(parentFrame, errorPane);
}