JobSheets [] supported =
(myService.isAttributeCategorySupported(JobSheets.class)
? (JobSheets[]) (myService.getSupportedAttributeValues(
JobSheets.class, flavor, attrs))
: null);
Attribute value = attrs.get(JobSheets.class);
if ((supported != null) && (supported.length == 0)) {
supported = null;
}
if (supported == null) {
/* if PrintService does not supported any JobSheets, set current
meaning from attribute set (if present) and disable checkbox */
if (firstUse && attrs.containsKey(JobSheets.class)) {
bannerBox.setSelected(value.equals(JobSheets.STANDARD));
}
} else {
if (supported.length == 1) {
bannerBox.setSelected(supported[0] == JobSheets.STANDARD);
} else if (attrs.containsKey(JobSheets.class)) {
bannerBox.setSelected(value.equals(JobSheets.STANDARD));
} else {
Object def = myService.getDefaultAttributeValue(JobSheets.class);
bannerBox.setSelected(def == null
? false
: def.equals(JobSheets.STANDARD));