View Javadoc

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