001/**
002 * Copyright 2005-2016 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 */
016package org.kuali.rice.krad.uif.control;
017
018
019/**
020 * Represents a HTML Select control. Provides preset options for the User to
021 * choose from by a drop down
022 *
023 * @author Kuali Rice Team (rice.collab@kuali.org)
024 */
025public class SelectControl extends MultiValueControlBase implements SizedControl {
026    private static final long serialVersionUID = 6443247954759096815L;
027
028    private int size;
029    private boolean multiple;
030
031    public SelectControl() {
032        size = 1;
033        multiple = false;
034    }
035
036    /**
037     * Vertical size of the control. This determines how many options can be
038     * seen without using the control scoll bar. Defaults to 1
039     *
040     * @return int size
041     */
042    public int getSize() {
043        return this.size;
044    }
045
046    /**
047     * @see org.kuali.rice.krad.uif.control.SizedControl#setSize(int)
048     */
049    public void setSize(int size) {
050        this.size = size;
051    }
052
053    /**
054     * Indicates whether multiple values can be selected. Defaults to false
055     * <p>
056     * If multiple is set to true, the underlying property must be of Array type
057     * </p>
058     *
059     * @return boolean true if multiple values can be selected, false if only
060     *         one value can be selected
061     */
062    public boolean isMultiple() {
063        return this.multiple;
064    }
065
066    public void setMultiple(boolean multiple) {
067        this.multiple = multiple;
068    }
069
070}