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


Java ErrorInfo.getErrorException方法代码示例

本文整理汇总了Java中org.jdesktop.swingx.error.ErrorInfo.getErrorException方法的典型用法代码示例。如果您正苦于以下问题:Java ErrorInfo.getErrorException方法的具体用法?Java ErrorInfo.getErrorException怎么用?Java ErrorInfo.getErrorException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jdesktop.swingx.error.ErrorInfo的用法示例。


在下文中一共展示了ErrorInfo.getErrorException方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDetailsAsHTML

import org.jdesktop.swingx.error.ErrorInfo; //导入方法依赖的package包/类
/**
 * Creates and returns HTML representing the details of this incident info. This
 * method is only called if the details needs to be generated: ie: the detailed
 * error message property of the incident info is null.
 */
protected String getDetailsAsHTML(ErrorInfo errorInfo) {
    if (errorInfo.getErrorException() != null) {
        //convert the stacktrace into a more pleasent bit of HTML
        StringBuffer html = new StringBuffer("<html>");
        html.append("<h2>" + escapeXml(errorInfo.getTitle()) + "</h2>");
        html.append("<HR size='1' noshade>");
        html.append("<div></div>");
        html.append("<b>Message:</b>");
        html.append("<pre>");
        html.append("    " + escapeXml(errorInfo.getErrorException().toString()));
        html.append("</pre>");
        html.append("<b>Level:</b>");
        html.append("<pre>");
        html.append("    " + errorInfo.getErrorLevel());
        html.append("</pre>");
        html.append("<b>Stack Trace:</b>");
        Throwable ex = errorInfo.getErrorException();
        while (ex != null) {
            html.append("<h4>" + ex.getMessage() + "</h4>");
            html.append("<pre>");
            for (StackTraceElement el : ex.getStackTrace()) {
                html.append("    " + el.toString().replace("<init>", "&lt;init&gt;") + "\n");
            }
            html.append("</pre>");
            ex = ex.getCause();
        }
        html.append("</html>");
        return html.toString();
    } else {
        return null;
    }
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:38,代码来源:BasicErrorPaneUI.java

示例2: getDetailsAsHTML

import org.jdesktop.swingx.error.ErrorInfo; //导入方法依赖的package包/类
/**
 * Creates and returns HTML representing the details of this incident info. This
 * method is only called if the details needs to be generated: ie: the detailed
 * error message property of the incident info is null.
 */
protected String getDetailsAsHTML(ErrorInfo errorInfo) {
    if(errorInfo.getErrorException() != null) {
        //convert the stacktrace into a more pleasent bit of HTML
        StringBuffer html = new StringBuffer("<html>");
        html.append("<h2>" + escapeXml(errorInfo.getTitle()) + "</h2>");
        html.append("<HR size='1' noshade>");
        html.append("<div></div>");
        html.append("<b>Message:</b>");
        html.append("<pre>");
        html.append("    " + escapeXml(errorInfo.getErrorException().toString()));
        html.append("</pre>");
        html.append("<b>Level:</b>");
        html.append("<pre>");
        html.append("    " + errorInfo.getErrorLevel());
        html.append("</pre>");
        html.append("<b>Stack Trace:</b>");
        Throwable ex = errorInfo.getErrorException();
        while(ex != null) {
            html.append("<h4>"+ex.getMessage()+"</h4>");
            html.append("<pre>");
            for (StackTraceElement el : ex.getStackTrace()) {
                html.append("    " + el.toString().replace("<init>", "&lt;init&gt;") + "\n");
            }
            html.append("</pre>");
            ex = ex.getCause();
        }
        html.append("</html>");
        return html.toString();
    } else {
        return null;
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:38,代码来源:BasicErrorPaneUI.java


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