当前位置: 首页>>代码示例>>Java>>正文


Java JXErrorPane.setErrorInfo方法代码示例

本文整理汇总了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();
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:27,代码来源:WidgetUtils.java

示例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);
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:21,代码来源:RcpSupport.java

示例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);

}
 
开发者ID:hohonuuli,项目名称:vars,代码行数:24,代码来源:FatalExceptionSubscriber.java

示例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);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:34,代码来源:DesktopWindowManager.java

示例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;
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:31,代码来源:DefaultExceptionHandler.java

示例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);
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:18,代码来源:JXErrorDialogExceptionHandler.java

示例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);
}
 
开发者ID:hohonuuli,项目名称:vars,代码行数:34,代码来源:NonFatalErrorSubscriber.java


注:本文中的org.jdesktop.swingx.JXErrorPane.setErrorInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。