1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.container;
17
18 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
19 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
20 import org.kuali.rice.krad.datadictionary.parse.BeanTags;
21 import org.kuali.rice.krad.uif.UifConstants;
22 import org.kuali.rice.krad.uif.component.Component;
23 import org.kuali.rice.krad.uif.view.View;
24 import org.kuali.rice.krad.uif.widget.Tabs;
25
26 import java.util.HashSet;
27 import java.util.List;
28 import java.util.Set;
29
30
31
32
33
34
35
36
37 @BeanTags(
38 {@BeanTag(name = "tabGroup-bean", parent = "Uif-TabGroup"), @BeanTag(name = "tabSection-bean", parent = "Uif-TabSection"),
39 @BeanTag(name = "tabSubSection-bean", parent = "Uif-TabSubSection")})
40 public class TabGroup extends Group {
41 private static final long serialVersionUID = 3L;
42
43 private Tabs tabsWidget;
44
45 public TabGroup() {
46 super();
47 }
48
49
50
51
52 @Override
53 public List<Component> getComponentsForLifecycle() {
54 List<Component> components = super.getComponentsForLifecycle();
55
56 components.add(tabsWidget);
57
58 return components;
59 }
60
61 @Override
62 public void performFinalize(View view, Object model, Component parent) {
63 super.performFinalize(view, model, parent);
64 this.addDataAttribute(UifConstants.DataAttributes.TYPE, "Uif-TabGroup");
65 }
66
67
68
69
70
71
72 @Override
73 public Set<Class<? extends Component>> getSupportedComponents() {
74 Set<Class<? extends Component>> supportedComponents = new HashSet<Class<? extends Component>>();
75 supportedComponents.add(Group.class);
76
77 return supportedComponents;
78 }
79
80
81
82
83
84
85
86 @BeanTagAttribute(name = "tabsWidget", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
87 public Tabs getTabsWidget() {
88 return this.tabsWidget;
89 }
90
91
92
93
94 public void setTabsWidget(Tabs tabsWidget) {
95 this.tabsWidget = tabsWidget;
96 }
97
98
99
100
101 @Override
102 protected <T> void copyProperties(T component) {
103 super.copyProperties(component);
104 TabGroup tabGroupCopy = (TabGroup) component;
105
106 if(tabsWidget != null) {
107 tabGroupCopy.setTabsWidget((Tabs)this.getTabsWidget().copy());
108 }
109 }
110
111 }