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.container;
017
018import org.kuali.rice.krad.uif.component.Component;
019import org.kuali.rice.krad.uif.widget.Tabs;
020
021import java.util.HashSet;
022import java.util.List;
023import java.util.Set;
024
025/**
026 * A group that presents its child Groups as tabs.  Items in this group's item list must be Groups
027 * themselves.
028 *
029 * @author Kuali Rice Team (rice.collab@kuali.org)
030 * @see Group
031 */
032public class TabGroup extends Group {
033    private static final long serialVersionUID = 3L;
034
035    private Tabs tabsWidget;
036
037    public TabGroup() {
038        super();
039    }
040
041    /**
042     * @see org.kuali.rice.krad.uif.component.ComponentBase#getComponentsForLifecycle()
043     */
044    @Override
045    public List<Component> getComponentsForLifecycle() {
046        List<Component> components = super.getComponentsForLifecycle();
047
048        components.add(tabsWidget);
049
050        return components;
051    }
052
053    /**
054     * Only groups are supported for this group.
055     *
056     * @see org.kuali.rice.krad.web.view.container.ContainerBase#getSupportedComponents()
057     */
058    @Override
059    public Set<Class<? extends Component>> getSupportedComponents() {
060        Set<Class<? extends Component>> supportedComponents = new HashSet<Class<? extends Component>>();
061        supportedComponents.add(Group.class);
062
063        return supportedComponents;
064    }
065
066    /**
067     * Gets the widget which contains any configuration for the tab widget component used to render
068     * this TabGroup
069     *
070     * @return the tabsWidget
071     */
072    public Tabs getTabsWidget() {
073        return this.tabsWidget;
074    }
075
076    /**
077     * @param tabsWidget the tabsWidget to set
078     */
079    public void setTabsWidget(Tabs tabsWidget) {
080        this.tabsWidget = tabsWidget;
081    }
082
083}