本文整理汇总了Java中org.jdesktop.swingx.JXErrorPane.setErrorInfo方法的典型用法代码示例。如果您正苦于以下问题:Java JXErrorPane.setErrorInfo方法的具体用法?Java JXErrorPane.setErrorInfo怎么用?Java JXErrorPane.setErrorInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.swingx.JXErrorPane
的用法示例。
在下文中一共展示了JXErrorPane.setErrorInfo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showErrorMessage
import org.jdesktop.swingx.JXErrorPane; //导入方法依赖的package包/类
public static void showErrorMessage(final String shortMessage, final String detailedMessage,
final Throwable exception) {
final Throwable presentedException = ErrorUtils.unwrapForPresentation(exception);
if (exception == null) {
showErrorMessage(shortMessage, detailedMessage);
return;
}
final String finalDetailedMessage = detailedMessage == null ? "" : detailedMessage;
final String finalShortMessage = shortMessage == null ? "" : shortMessage;
final ErrorInfo info = new ErrorInfo(finalShortMessage, finalDetailedMessage, null, "error", presentedException,
ErrorLevel.SEVERE, null);
final JXErrorPane errorPane = new JXErrorPane();
errorPane.setErrorInfo(info);
final JDialog dialog = JXErrorPane.createDialog(null, errorPane);
centerOnScreen(dialog);
JXErrorPane.setDefaultLocale(Locale.ENGLISH);
dialog.setLocale(Locale.ENGLISH);
dialog.setModal(true);
dialog.setTitle(finalShortMessage);
dialog.setVisible(true);
dialog.toFront();
}
示例2: 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);
}
示例3: 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);
}
示例4: showExceptionDialog
import org.jdesktop.swingx.JXErrorPane; //导入方法依赖的package包/类
@Override
public void showExceptionDialog(Throwable throwable, @Nullable String caption, @Nullable String message) {
Preconditions.checkNotNullArgument(throwable);
JXErrorPane errorPane = new JXErrorPaneExt();
errorPane.setErrorInfo(createErrorInfo(caption, message, throwable));
final TopLevelFrame mainFrame = App.getInstance().getMainFrame();
JDialog dialog = JXErrorPane.createDialog(mainFrame, errorPane);
dialog.setMinimumSize(new Dimension(600, (int) dialog.getMinimumSize().getHeight()));
final DialogWindow lastDialogWindow = getLastDialogWindow();
dialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
if (lastDialogWindow != null) {
lastDialogWindow.enableWindow();
} else {
mainFrame.activate();
}
}
});
dialog.setModal(false);
if (lastDialogWindow != null) {
lastDialogWindow.disableWindow(null);
} else {
mainFrame.deactivate(null);
}
dialog.setVisible(true);
}
示例5: handle
import org.jdesktop.swingx.JXErrorPane; //导入方法依赖的package包/类
@Override
public boolean handle(Thread thread, Throwable exception) {
JXErrorPane errorPane = new JXErrorPaneExt();
errorPane.setErrorInfo(createErrorInfo(exception));
JDialog dialog = JXErrorPane.createDialog(App.getInstance().getMainFrame(), errorPane);
dialog.setMinimumSize(new Dimension(600, (int) dialog.getMinimumSize().getHeight()));
final DialogWindow lastDialogWindow = getLastDialogWindow();
dialog.addWindowListener(
new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
if (lastDialogWindow != null)
lastDialogWindow.enableWindow();
else
App.getInstance().getMainFrame().activate();
}
}
);
dialog.setModal(false);
if (lastDialogWindow != null)
lastDialogWindow.disableWindow(null);
else
App.getInstance().getMainFrame().deactivate(null);
dialog.setVisible(true);
return true;
}
示例6: 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);
}
示例7: 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);
}