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


Java ErrorInfo.getErrorLevel方法代码示例

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


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

示例1: reinit

import org.jdesktop.swingx.error.ErrorInfo; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void reinit() {
    super.reinit();
    ErrorInfo info = pane == null ? null : pane.getErrorInfo();
    titleLabel.setText(info == null ? "Unknown Error" : info.getTitle());

    Object finePrint = pane.getClientProperty("fine-print");
    String text = finePrint == null ? null : finePrint.toString();
    disclaimerText.setText(text);
    disclaimerText.setVisible(text != null);

    if ((info != null) && (info.getErrorLevel() == ErrorLevel.FATAL)) {
        closeButton.setText(UIManagerExt.getString(CLASS_NAME + ".fatal_button_text", closeButton.getLocale()));
    } else {
        closeButton.setText(UIManagerExt.getString(CLASS_NAME + ".ok_button_text", closeButton.getLocale()));
    }
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:21,代码来源:MacOSXErrorPaneUI.java

示例2: reinit

import org.jdesktop.swingx.error.ErrorInfo; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void reinit() {
    super.reinit();
    ErrorInfo info = pane == null ? null : pane.getErrorInfo();
    titleLabel.setText(info == null ? "Unknown Error" : info.getTitle());
    
    Object finePrint = pane.getClientProperty("fine-print");
    String text = finePrint == null ? null : finePrint.toString();
    disclaimerText.setText(text);
    disclaimerText.setVisible(text != null);
    
    if (info != null && info.getErrorLevel() == ErrorLevel.FATAL) {
        closeButton.setText(UIManagerExt.getString(CLASS_NAME + ".fatal_button_text", closeButton.getLocale()));
    } else {
        closeButton.setText(UIManagerExt.getString(CLASS_NAME + ".ok_button_text", closeButton.getLocale()));
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:21,代码来源:MacOSXErrorPaneUI.java

示例3: reinit

import org.jdesktop.swingx.error.ErrorInfo; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void reinit() {
    super.reinit();
    ErrorInfo info = pane == null ? null : pane.getErrorInfo();
    titleLabel.setText(info == null ? "Unknown Error" : info.getTitle());
    
    Object finePrint = pane.getClientProperty("fine-print");
    String text = finePrint == null ? null : finePrint.toString();
    disclaimerText.setText(text);
    disclaimerText.setVisible(text != null);
    
    if (info != null && info.getErrorLevel() == ErrorLevel.FATAL) {
        closeButton.setText(UIManagerExt.getString(CLASS_NAME + ".fatal_button_text", closeButton.getLocale()));
    } else {
        closeButton.setText(UIManagerExt.getString(CLASS_NAME + ".ok_button_text", closeButton.getLocale()));
    }
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:20,代码来源:MacOSXErrorPaneUI.java

示例4: exitIfFatal

import org.jdesktop.swingx.error.ErrorInfo; //导入方法依赖的package包/类
private void exitIfFatal() {
    ErrorInfo info = pane.getErrorInfo();
    // FYI: info can be null
    if ((info != null) && (info.getErrorLevel() == ErrorLevel.FATAL)) {
        Action fatalAction = pane.getActionMap().get(JXErrorPane.FATAL_ACTION_KEY);
        if (fatalAction == null) {
            System.exit(1);
        } else {
            ActionEvent ae = new ActionEvent(closeButton, -1, "fatal");
            fatalAction.actionPerformed(ae);
        }
    }
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:14,代码来源:BasicErrorPaneUI.java

示例5: exitIfFatal

import org.jdesktop.swingx.error.ErrorInfo; //导入方法依赖的package包/类
private void exitIfFatal() {
    ErrorInfo info = pane.getErrorInfo();
    // FYI: info can be null
    if (info != null && info.getErrorLevel() == ErrorLevel.FATAL) {
        Action fatalAction = pane.getActionMap().get(JXErrorPane.FATAL_ACTION_KEY);
        if (fatalAction == null) {
            System.exit(1);
        } else {
            ActionEvent ae = new ActionEvent(closeButton, -1, "fatal");
            fatalAction.actionPerformed(ae);
        }
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:14,代码来源:BasicErrorPaneUI.java

示例6: reinit

import org.jdesktop.swingx.error.ErrorInfo; //导入方法依赖的package包/类
/**
 * Reconfigures the dialog if settings have changed, such as the
 * errorInfo, errorIcon, warningIcon, etc
 */
protected void reinit() {
    setDetailsVisible(false);
    Action reportAction = pane.getActionMap().get(JXErrorPane.REPORT_ACTION_KEY);
    reportButton.setAction(reportAction);
    reportButton.setVisible((reportAction != null) && reportAction.isEnabled() && (pane.getErrorReporter() != null));
    reportButton.setEnabled(reportButton.isVisible());
    ErrorInfo errorInfo = pane.getErrorInfo();
    if (errorInfo == null) {
        iconLabel.setIcon(pane.getIcon());
        setErrorMessage("");
        closeButton.setText(UIManagerExt.getString(
                CLASS_NAME + ".ok_button_text", closeButton.getLocale()));
        setDetails("");
        //TODO Does this ever happen? It seems like if errorInfo is null and
        //this is called, it would be an IllegalStateException.
    } else {
        //change the "closeButton"'s text to either the default "ok"/"close" text
        //or to the "fatal" text depending on the error level of the incident info
        if (errorInfo.getErrorLevel() == ErrorLevel.FATAL) {
            closeButton.setText(UIManagerExt.getString(
                    CLASS_NAME + ".fatal_button_text", closeButton.getLocale()));
        } else {
            closeButton.setText(UIManagerExt.getString(
                    CLASS_NAME + ".ok_button_text", closeButton.getLocale()));
        }

        //if the icon for the pane has not been specified by the developer,
        //then set it to the default icon based on the error level
        Icon icon = pane.getIcon();
        if ((icon == null) || (icon instanceof UIResource)) {
            if (errorInfo.getErrorLevel().intValue() <= Level.WARNING.intValue()) {
                icon = getDefaultWarningIcon();
            } else {
                icon = getDefaultErrorIcon();
            }
        }
        iconLabel.setIcon(icon);
        setErrorMessage(errorInfo.getBasicErrorMessage());
        String details = errorInfo.getDetailedErrorMessage();
        if (details == null) {
            details = getDetailsAsHTML(errorInfo);
        }
        setDetails(details);
    }
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:50,代码来源:BasicErrorPaneUI.java

示例7: reinit

import org.jdesktop.swingx.error.ErrorInfo; //导入方法依赖的package包/类
/**
 * Reconfigures the dialog if settings have changed, such as the
 * errorInfo, errorIcon, warningIcon, etc
 */
protected void reinit() {
    setDetailsVisible(false);
    Action reportAction = pane.getActionMap().get(JXErrorPane.REPORT_ACTION_KEY);
    reportButton.setAction(reportAction);
    reportButton.setVisible(reportAction != null && reportAction.isEnabled() && pane.getErrorReporter() != null);
    reportButton.setEnabled(reportButton.isVisible());
    ErrorInfo errorInfo = pane.getErrorInfo();
    if (errorInfo == null) {
        iconLabel.setIcon(pane.getIcon());
        setErrorMessage("");
        closeButton.setText(UIManagerExt.getString(
                CLASS_NAME + ".ok_button_text", closeButton.getLocale()));
        setDetails("");
        //TODO Does this ever happen? It seems like if errorInfo is null and
        //this is called, it would be an IllegalStateException.
    } else {
        //change the "closeButton"'s text to either the default "ok"/"close" text
        //or to the "fatal" text depending on the error level of the incident info
        if (errorInfo.getErrorLevel() == ErrorLevel.FATAL) {
            closeButton.setText(UIManagerExt.getString(
                    CLASS_NAME + ".fatal_button_text", closeButton.getLocale()));
        } else {
            closeButton.setText(UIManagerExt.getString(
                    CLASS_NAME + ".ok_button_text", closeButton.getLocale()));
        }

        //if the icon for the pane has not been specified by the developer,
        //then set it to the default icon based on the error level
        Icon icon = pane.getIcon();
        if (icon == null || icon instanceof UIResource) {
            if (errorInfo.getErrorLevel().intValue() <= Level.WARNING.intValue()) {
                icon = getDefaultWarningIcon();
            } else {
                icon = getDefaultErrorIcon();
            }
        }
        iconLabel.setIcon(icon);
        setErrorMessage(errorInfo.getBasicErrorMessage());
        String details = errorInfo.getDetailedErrorMessage();
        if(details == null) {
            details = getDetailsAsHTML(errorInfo);
        }
        setDetails(details);
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:50,代码来源:BasicErrorPaneUI.java


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