View Javadoc
1   /**
2    * Copyright 2005-2014 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/ecl2.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 org.kuali.rice.krad.uif.control;
17  
18  import org.kuali.rice.core.api.util.KeyValue;
19  import org.kuali.rice.krad.datadictionary.parse.BeanTag;
20  import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
21  import org.kuali.rice.krad.keyvalues.KeyValuesBase;
22  import org.kuali.rice.krad.uif.field.InputField;
23  import org.kuali.rice.krad.uif.view.ViewModel;
24  
25  import java.util.Collections;
26  import java.util.List;
27  
28  /**
29   * @author Kuali Rice Team (rice.collab@kuali.org)
30   */
31  @BeanTag(name = "keyValuesFinder")
32  public abstract class UifKeyValuesFinderBase extends KeyValuesBase implements UifKeyValuesFinder {
33  
34      private boolean addBlankOption;
35  
36      public UifKeyValuesFinderBase() {
37          addBlankOption = true;
38      }
39  
40      /**
41       * {@inheritDoc}
42       */
43      public List<KeyValue> getKeyValues() {
44          return Collections.emptyList();
45      }
46  
47      /**
48       * {@inheritDoc}
49       */
50      @Override
51      public List<KeyValue> getKeyValues(ViewModel model) {
52          return getKeyValues();
53      }
54  
55      /**
56       * {@inheritDoc}
57       */
58      @Override
59      public List<KeyValue> getKeyValues(ViewModel model, InputField field){
60          return getKeyValues(model);
61      }
62  
63      /**
64       * {@inheritDoc}
65       */
66      @BeanTagAttribute
67      @Override
68      public boolean isAddBlankOption() {
69          return addBlankOption;
70      }
71  
72      /**
73       * Setter for the addBlankOption indicator
74       *
75       * @param addBlankOption
76       */
77      public void setAddBlankOption(boolean addBlankOption) {
78          this.addBlankOption = addBlankOption;
79      }
80  }