View Javadoc

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