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


Java JobStateReason类代码示例

本文整理汇总了Java中javax.print.attribute.standard.JobStateReason的典型用法代码示例。如果您正苦于以下问题:Java JobStateReason类的具体用法?Java JobStateReason怎么用?Java JobStateReason使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testIsAttributeCategorySupported

import javax.print.attribute.standard.JobStateReason; //导入依赖的package包/类
public void testIsAttributeCategorySupported() {
    System.out
            .println("============= START testIsAttributeCategorySupported ================");

    PrintService[] services;
    Class[] claz;
    boolean supported;

    services = PrintServiceLookup.lookupPrintServices(null, null);
    TestUtil.checkServices(services);
    for (int i = 0, ii = services.length; i < ii; i++) {
        System.out.println("------------------" + services[i].getName()
                + "-------------------");
        claz = services[i].getSupportedAttributeCategories();
        for (int j = 0, jj = claz.length; j < jj; j++) {
            supported = services[i].isAttributeCategorySupported(claz[j]);
            if (!supported) {
                fail("Category " + claz[j] + " must be supported.");
            }
            System.out.println(claz[j] + ": " + supported);
        }

        supported = services[i]
                .isAttributeCategorySupported(JobStateReason.ABORTED_BY_SYSTEM
                        .getCategory());
        if (supported) {
            fail("Category "
                    + JobStateReason.ABORTED_BY_SYSTEM.getCategory()
                    + " must not be supported.");
        }
        System.out.println(JobStateReason.ABORTED_BY_SYSTEM.getCategory()
                + ": " + supported);
    }

    System.out
            .println("============= END testIsAttributeCategorySupported ================");
}
 
开发者ID:shannah,项目名称:cn1,代码行数:38,代码来源:IsAttributeCategorySupportedTest.java


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