本文整理汇总了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 ================");
}