if (isEnabled) {
int value = (firstUse && attrs.containsKey(Copies.class)
? ((Copies) (attrs.get(Copies.class))).getValue()
: ((Integer) cpSpinner.getValue()).intValue());
CopiesSupported supported = (CopiesSupported) myService
.getSupportedAttributeValues(Copies.class, flavor, attrs);
Copies defaul = (Copies)
myService.getDefaultAttributeValue(Copies.class);
if(supported == null) {
/*
* It is incorrect situation, however it is possible: Copies
* category is supported, but there are no supported values. I
* suppose that only default Copies value is supported in this
* case. If default Copies value is null - I suppose that default
* and supported value is 1 Copy only.
*/
supported = new CopiesSupported( (defaul == null)
? defaul.getValue()
: 1);
}
int [][] range = supported.getMembers();
if (!supported.contains(value)) {
value = (((defaul == null)
|| (!supported.contains(defaul.getValue())))
? range[0][0]
: defaul.getValue());
}
cpSpinner.setModel(