1 /*
2 * Copyright 2011 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl1.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
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.api.util.ConcreteKeyValue;
22 import org.kuali.rice.core.api.util.KeyValue;
23 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
24
25 /**
26 * TODO Administrator don't forget to fill this in.
27 *
28 * @author Kuali Rice Team (rice.collab@kuali.org)
29 */
30 public class SimpleTestKeyValues extends KeyValuesBase{
31
32 private boolean blankOption;
33
34 /**
35 * This is a fake implementation of a key value finder, normally this would make a request to
36 * a database to obtain the necessary values. Used only for testing.
37 *
38 * @see org.kuali.rice.krad.keyvalues.KeyValuesFinder#getKeyValues()
39 */
40 @Override
41 public List<KeyValue> getKeyValues() {
42 List<KeyValue> keyValues = new ArrayList<KeyValue>();
43 if(blankOption){
44 keyValues.add(new ConcreteKeyValue("", ""));
45 }
46 keyValues.add(new ConcreteKeyValue("1", "Option 1"));
47 keyValues.add(new ConcreteKeyValue("2", "Option 2"));
48 keyValues.add(new ConcreteKeyValue("3", "Option 3"));
49 keyValues.add(new ConcreteKeyValue("4", "Option 4"));
50 keyValues.add(new ConcreteKeyValue("5", "Option 5"));
51 return keyValues;
52 }
53
54 /**
55 * @return the blankOption
56 */
57 public boolean isBlankOption() {
58 return this.blankOption;
59 }
60
61 /**
62 * @param blankOption the blankOption to set
63 */
64 public void setBlankOption(boolean blankOption) {
65 this.blankOption = blankOption;
66 }
67
68
69
70 }