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.container;
17
18 import org.kuali.rice.krad.uif.component.Component;
19 import org.kuali.rice.krad.uif.view.View;
20 import org.kuali.rice.krad.uif.widget.Tabs;
21
22 import java.util.HashSet;
23 import java.util.List;
24 import java.util.Set;
25
26 /**
27 * A group that presents its child Groups as tabs. Items in this group's item list must be Groups
28 * themselves.
29 *
30 * @author Kuali Rice Team (rice.collab@kuali.org)
31 * @see Group
32 */
33 public class TabGroup extends Group {
34 private static final long serialVersionUID = 3L;
35
36 private Tabs tabsWidget;
37
38 public TabGroup() {
39 super();
40 }
41
42 /**
43 * @see org.kuali.rice.krad.uif.component.ComponentBase#getComponentsForLifecycle()
44 */
45 @Override
46 public List<Component> getComponentsForLifecycle() {
47 List<Component> components = super.getComponentsForLifecycle();
48
49 components.add(tabsWidget);
50
51 return components;
52 }
53
54 @Override
55 public void performFinalize(View view, Object model, Component parent) {
56 super.performFinalize(view, model,parent);
57 this.addDataAttribute("type","Uif-TabGroup");
58 }
59
60 /**
61 * Only groups are supported for this group.
62 *
63 * @see org.kuali.rice.krad.web.view.container.ContainerBase#getSupportedComponents()
64 */
65 @Override
66 public Set<Class<? extends Component>> getSupportedComponents() {
67 Set<Class<? extends Component>> supportedComponents = new HashSet<Class<? extends Component>>();
68 supportedComponents.add(Group.class);
69
70 return supportedComponents;
71 }
72
73 /**
74 * Gets the widget which contains any configuration for the tab widget component used to render
75 * this TabGroup
76 *
77 * @return the tabsWidget
78 */
79 public Tabs getTabsWidget() {
80 return this.tabsWidget;
81 }
82
83 /**
84 * @param tabsWidget the tabsWidget to set
85 */
86 public void setTabsWidget(Tabs tabsWidget) {
87 this.tabsWidget = tabsWidget;
88 }
89
90 }