1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package edu.sampleu.travel.document.keyvalue; |
17 | |
|
18 | |
import java.util.ArrayList; |
19 | |
import java.util.List; |
20 | |
|
21 | |
import org.kuali.rice.core.util.KeyValue; |
22 | |
import org.kuali.rice.core.util.ConcreteKeyValue; |
23 | |
import org.kuali.rice.kns.document.Document; |
24 | |
import org.kuali.rice.kns.lookup.keyvalues.KeyValuesBase; |
25 | |
import org.kuali.rice.kns.util.GlobalVariables; |
26 | |
import org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase; |
27 | |
import org.kuali.rice.kns.web.struts.form.KualiForm; |
28 | |
|
29 | 0 | public class TravelRequestType extends KeyValuesBase { |
30 | |
|
31 | |
public List getKeyValues() { |
32 | 0 | List<KeyValue> keyValues = new ArrayList<KeyValue>(); |
33 | |
|
34 | 0 | keyValues.add(new ConcreteKeyValue("", "")); |
35 | 0 | keyValues.add(new ConcreteKeyValue("TRT1", "Travel Request Type 1")); |
36 | 0 | keyValues.add(new ConcreteKeyValue("TRT2", "Travel Request Type 2")); |
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | 0 | KualiForm form = GlobalVariables.getKualiForm(); |
42 | 0 | if ((form != null) && (form instanceof KualiDocumentFormBase)) { |
43 | 0 | Document doc =((KualiDocumentFormBase)form).getDocument(); |
44 | 0 | if (doc != null) { |
45 | 0 | keyValues.add(new ConcreteKeyValue("TRT3", "Travel Request Type 3")); |
46 | |
} |
47 | |
} |
48 | |
|
49 | 0 | return keyValues; |
50 | |
} |
51 | |
|
52 | |
} |