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.krad.uif.component.Component;
019import org.kuali.rice.krad.uif.widget.Spinner;
020
021import java.util.List;
022
023/**
024 * Text control that as decorated with a spinner widget (allowing the control value to be modified using the
025 * spinner)
026 *
027 * @author Kuali Rice Team (rice.collab@kuali.org)
028 */
029public class SpinnerControl extends TextControl {
030    private static final long serialVersionUID = -8267606288443759880L;
031
032    private Spinner spinner;
033
034    public SpinnerControl() {
035        super();
036    }
037
038    /**
039     * @see org.kuali.rice.krad.uif.component.ComponentBase#getComponentsForLifecycle()
040     */
041    @Override
042    public List<Component> getComponentsForLifecycle() {
043        List<Component> components = super.getComponentsForLifecycle();
044
045        components.add(getSpinner());
046
047        return components;
048    }
049
050    /**
051     * Spinner widget that should decorate the control
052     *
053     * @return Spinner
054     */
055    public Spinner getSpinner() {
056        return spinner;
057    }
058
059    /**
060     * Setter for the control's spinner widget instance
061     *
062     * @param spinner
063     */
064    public void setSpinner(Spinner spinner) {
065        this.spinner = spinner;
066    }
067}