1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.businessobject.options;
17
18 import org.kuali.ole.module.purap.PurapConstants.PurchaseOrderStatuses;
19 import org.kuali.rice.core.api.util.ConcreteKeyValue;
20 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
21
22 import java.util.ArrayList;
23 import java.util.List;
24 import java.util.SortedSet;
25 import java.util.TreeSet;
26
27
28
29
30 public class PurchaseOrderStatusValuesFinder extends KeyValuesBase {
31
32
33
34
35
36
37 public List getKeyValues() {
38
39 SortedSet<String> incompleteCodes = new TreeSet<String>(PurchaseOrderStatuses.INCOMPLETE_STATUSES);
40 SortedSet<String> completeCodes = new TreeSet<String>(PurchaseOrderStatuses.COMPLETE_STATUSES);
41
42
43 List labels = new ArrayList();
44
45 labels.add(new ConcreteKeyValue("INCOMPLETE", "INCOMPLETE STATUSES"));
46 for (String status : incompleteCodes) {
47 labels.add(new ConcreteKeyValue(status, "- " + status));
48 }
49
50 labels.add(new ConcreteKeyValue("COMPLETE", "COMPLETE STATUSES"));
51 for (String status : completeCodes) {
52 labels.add(new ConcreteKeyValue(status, "- " + status));
53 }
54
55 return labels;
56 }
57
58 }