01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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 org.kuali.module.gl.web.optionfinder;
17:
18: import java.util.ArrayList;
19: import java.util.List;
20:
21: import org.kuali.core.lookup.keyvalues.KeyValuesBase;
22: import org.kuali.core.lookup.valueFinder.ValueFinder;
23: import org.kuali.core.web.ui.KeyLabelPair;
24: import org.kuali.module.gl.web.Constant;
25:
26: /**
27: * An implmentation of ValueFinder that allows the balance inquiries to choose whether to include or exclude cost share entries
28: */
29: public class GLCostShareOptionFinder extends KeyValuesBase implements
30: ValueFinder {
31:
32: /**
33: * Returns the default value for this ValueFinder, in this case, exclude cost share entries
34: * @return a String with the default key
35: * @see org.kuali.core.lookup.valueFinder.ValueFinder#getValue()
36: */
37: public String getValue() {
38: return Constant.COST_SHARE_EXCLUDE;
39: }
40:
41: /**
42: * Returns a list of possible values for this ValueFinder, in this case include cost share entries or exclude cost share entries
43: * @return a List of key/value pairs to populate radio buttons
44: * @see org.kuali.core.lookup.keyvalues.KeyValuesFinder#getKeyValues()
45: */
46: public List getKeyValues() {
47: List labels = new ArrayList();
48: labels.add(new KeyLabelPair(Constant.COST_SHARE_INCLUDE,
49: Constant.COST_SHARE_INCLUDE));
50: labels.add(new KeyLabelPair(Constant.COST_SHARE_EXCLUDE,
51: Constant.COST_SHARE_EXCLUDE));
52: return labels;
53: }
54: }
|