1 /*
2 * The Kuali Financial System, a comprehensive financial management system for higher education.
3 *
4 * Copyright 2005-2014 The Kuali Foundation
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 package org.kuali.kfs.gl.businessobject.options;
20
21 import java.util.ArrayList;
22 import java.util.List;
23
24 import org.kuali.kfs.gl.Constant;
25 import org.kuali.rice.core.api.util.ConcreteKeyValue;
26 import org.kuali.rice.core.api.util.KeyValue;
27 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
28 import org.kuali.rice.krad.valuefinder.ValueFinder;
29
30 /**
31 * An implmentation of ValueFinder that allows the balance inquiries to choose whether to show blank entries
32 */
33 public class BlankLineOptionFinder extends KeyValuesBase implements ValueFinder {
34
35 /**
36 * Returns the default value for this ValueFinder, in this case, exclude cost share entries
37 * @return a String with the default key
38 * @see org.kuali.rice.krad.valuefinder.ValueFinder#getValue()
39 */
40 public String getValue() {
41 return Constant.NOT_SHOW_BLANK_LINE;
42 }
43
44 /**
45 * Returns a list of possible values for this ValueFinder, in this case include cost share entries or exclude cost share entries
46 * @return a List of key/value pairs to populate radio buttons
47 * @see org.kuali.rice.kns.lookup.keyvalues.KeyValuesFinder#getKeyValues()
48 */
49 public List<KeyValue> getKeyValues() {
50 List<KeyValue> labels = new ArrayList<KeyValue>();
51 labels.add(new ConcreteKeyValue(Constant.NOT_SHOW_BLANK_LINE, Constant.NOT_SHOW_BLANK_LINE));
52 labels.add(new ConcreteKeyValue(Constant.SHOW_BLANK_LINE, Constant.SHOW_BLANK_LINE));
53 return labels;
54 }
55 }