001    /**
002     * Copyright 2005-2014 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package edu.sampleu.travel.document.keyvalue;
017    
018    import java.util.ArrayList;
019    import java.util.List;
020    
021    import org.kuali.rice.core.api.util.ConcreteKeyValue;
022    import org.kuali.rice.core.api.util.KeyValue;
023    import org.kuali.rice.krad.keyvalues.KeyValuesBase;
024    
025    /**
026     * TODO Administrator don't forget to fill this in. 
027     * 
028     * @author Kuali Rice Team (rice.collab@kuali.org)
029     */
030    public class SimpleTestKeyValues extends KeyValuesBase{
031        
032        private boolean blankOption;
033    
034        /**
035         * This is a fake implementation of a key value finder, normally this would make a request to
036         * a database to obtain the necessary values.  Used only for testing.
037         * 
038         * @see org.kuali.rice.krad.keyvalues.KeyValuesFinder#getKeyValues()
039         */
040        @Override
041        public List<KeyValue> getKeyValues() {
042            List<KeyValue> keyValues = new ArrayList<KeyValue>();
043            if(blankOption){
044                keyValues.add(new ConcreteKeyValue("", ""));
045            }
046            keyValues.add(new ConcreteKeyValue("1", "Option 1"));
047            keyValues.add(new ConcreteKeyValue("2", "Option 2"));
048            keyValues.add(new ConcreteKeyValue("3", "Option 3"));
049            keyValues.add(new ConcreteKeyValue("4", "Option 4"));
050            keyValues.add(new ConcreteKeyValue("5", "Option 5"));
051            return keyValues;
052        }
053    
054        /**
055         * @return the blankOption
056         */
057        public boolean isBlankOption() {
058            return this.blankOption;
059        }
060    
061        /**
062         * @param blankOption the blankOption to set
063         */
064        public void setBlankOption(boolean blankOption) {
065            this.blankOption = blankOption;
066        }
067        
068        
069    
070    }