1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.options;
17
18 import org.kuali.rice.core.api.util.ConcreteKeyValue;
19 import org.kuali.rice.core.api.util.KeyValue;
20 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
21 import org.kuali.rice.krad.uif.util.UifKeyValue;
22 import org.kuali.rice.krad.uif.util.UifOptionGroupLabel;
23
24 import java.util.ArrayList;
25 import java.util.HashMap;
26 import java.util.List;
27 import java.util.Vector;
28
29
30
31
32 public class SimpleTestKeyValuesLong extends KeyValuesBase {
33
34 private boolean blankOption;
35
36
37
38
39
40
41
42 @Override
43 public List<KeyValue> getKeyValues() {
44 List<KeyValue> keyValues = new ArrayList<KeyValue>();
45 String groupName;
46 String optionName;
47 Integer randomOption;
48 Integer minimum=2;
49 Integer maximum=25;
50
51 if (blankOption) {
52 keyValues.add(new UifKeyValue("", ""));
53 }
54 HashMap<String, Vector<String>> data = new HashMap();
55 for(int x = 1; x <= 20; x++) {
56 randomOption = minimum + (int)(Math.random()*maximum);
57 groupName = (String) "group " + x;
58 keyValues.add(new UifOptionGroupLabel(groupName));
59 for(int y = 1; y <= randomOption; y++) {
60 optionName = (String) "sub" + x + "_" + y;
61 keyValues.add(new UifKeyValue(optionName, optionName));
62 }
63 }
64 return keyValues;
65 }
66
67
68
69
70 public boolean isBlankOption() {
71 return this.blankOption;
72 }
73
74
75
76
77 public void setBlankOption(boolean blankOption) {
78 this.blankOption = blankOption;
79 }
80
81 }