View Javadoc
1   /**
2    * Copyright 2005-2016 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.krad.datadictionary.parse.BeanTag;
19  import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
20  import org.kuali.rice.krad.datadictionary.parse.BeanTags;
21  
22  /**
23   * Represents a HTML Select control. Provides preset options for the User to
24   * choose from by a drop down
25   *
26   * @author Kuali Rice Team (rice.collab@kuali.org)
27   */
28  @BeanTags({@BeanTag(name = "dropdownControl", parent = "Uif-DropdownControl"),
29          @BeanTag(name = "multiSelectControl", parent = "Uif-MultiSelectControl")})
30  public class SelectControlBase extends MultiValueControlBase implements SelectControl {
31      private static final long serialVersionUID = 6443247954759096815L;
32  
33      private int size;
34      private boolean multiple;
35  
36      public SelectControlBase() {
37          size = 1;
38          multiple = false;
39      }
40  
41      /**
42       * This overridden method ...
43       * 
44       * @see org.kuali.rice.krad.uif.control.SelectControl#getSize()
45       */
46      @Override
47      @BeanTagAttribute
48      public int getSize() {
49          return this.size;
50      }
51  
52      /**
53       * This overridden method ...
54       * 
55       * @see org.kuali.rice.krad.uif.control.SelectControl#setSize(int)
56       */
57      @Override
58      public void setSize(int size) {
59          this.size = size;
60      }
61  
62      /**
63       * Indicates whether multiple values can be selected. Defaults to false
64       * <p>
65       * If multiple is set to true, the underlying property must be of Array type
66       * </p>
67       *
68       * @return true if multiple values can be selected, false if only
69       *         one value can be selected
70       */
71      @Override
72      @BeanTagAttribute
73      public boolean isMultiple() {
74          return this.multiple;
75      }
76  
77      /**
78       * Set whether multiple values can be selected
79       *
80       * @param multiple
81       */
82      @Override
83      public void setMultiple(boolean multiple) {
84          this.multiple = multiple;
85      }
86  }