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
018import org.kuali.rice.core.api.util.KeyValue;
019
020import java.util.List;
021
022/**
023 * Indicates <code>Control</code> types that can hold more than one value for selection
024 *
025 * @author Kuali Rice Team (rice.collab@kuali.org)
026 */
027public interface MultiValueControl {
028
029    /**
030     * <code>List</code> of values the control can accept. Each value consists
031     * of a key and a label. The key is the what will be submitted back if the
032     * user selects the choice, the label is what will be displayed to the user
033     * for the choice.
034     * <p>
035     * <code>KeyLabelPair</code> instances are usually generated by the
036     * <code>KeyValueFinder</code> associated with the <code>Field</code> for
037     * which the control belongs
038     * </p>
039     *
040     * @return List of KeyLabelPair instances
041     */
042    public List<KeyValue> getOptions();
043
044    /**
045     * Sets the List of <code>KeyValue</code> pairs that make up the options for the control
046     *
047     * @param options
048     */
049    public void setOptions(List<KeyValue> options);
050}