View Javadoc

1   /**
2    * Copyright 2005-2015 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.List;
26  
27  /**
28   * @author Kuali Rice Team (rice.collab@kuali.org)
29   */
30  @BeanTag(name = "keyValuesFinder-bean")
31  public abstract class UifKeyValuesFinderBase extends KeyValuesBase implements UifKeyValuesFinder {
32  
33      private boolean addBlankOption;
34  
35      public UifKeyValuesFinderBase() {
36          addBlankOption = true;
37      }
38  
39      /**
40       * @see UifKeyValuesFinder#getKeyValues()
41       */
42      public List<KeyValue> getKeyValues() {
43          return null;
44      }
45  
46      /**
47       * @see UifKeyValuesFinder#getKeyValues(org.kuali.rice.krad.uif.view.ViewModel)
48       */
49      @Override
50      public List<KeyValue> getKeyValues(ViewModel model) {
51          return getKeyValues();
52      }
53  
54      /**
55       * @see UifKeyValuesFinder#getKeyValues(org.kuali.rice.krad.uif.view.ViewModel, org.kuali.rice.krad.uif.field.InputField)
56       */
57      @Override
58      public List<KeyValue> getKeyValues(ViewModel model, InputField field){
59          return getKeyValues(model);
60      }
61  
62      /**
63       * @see org.kuali.rice.krad.uif.control.UifKeyValuesFinder#isAddBlankOption()
64       */
65      @BeanTagAttribute(name="addBlankOption")
66      public boolean isAddBlankOption() {
67          return addBlankOption;
68      }
69  
70      /**
71       * Setter for the addBlankOption indicator
72       *
73       * @param addBlankOption
74       */
75      public void setAddBlankOption(boolean addBlankOption) {
76          this.addBlankOption = addBlankOption;
77      }
78  }