View Javadoc
1   /**
2    * Copyright 2005-2015 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 java.util.HashSet;
19  import java.util.Set;
20  
21  import org.kuali.rice.krad.datadictionary.parse.BeanTag;
22  import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
23  import org.kuali.rice.krad.datadictionary.parse.BeanTags;
24  import org.kuali.rice.krad.uif.UifConstants;
25  import org.kuali.rice.krad.uif.component.Component;
26  import org.kuali.rice.krad.uif.util.LifecycleElement;
27  import org.kuali.rice.krad.uif.widget.Accordion;
28  
29  /**
30   * Accordion group class used to stack groups by there header titles in an accordion layout.
31   *
32   * @author Kuali Rice Team (rice.collab@kuali.org)
33   */
34  @BeanTags({@BeanTag(name = "accordionGroup", parent = "Uif-AccordionGroup"),
35          @BeanTag(name = "accordionSection", parent = "Uif-AccordionSection"),
36          @BeanTag(name = "accordionSubSection", parent = "Uif-AccordionSubSection"),
37          @BeanTag(name = "disclosureAccordionSection", parent = "Uif-Disclosure-AccordionSection"),
38          @BeanTag(name = "disclosureAccordionSubSection", parent = "Uif-Disclosure-AccordionSubSection")})
39  public class AccordionGroup extends GroupBase {
40      private static final long serialVersionUID = 7230145606607506418L;
41  
42      private Accordion accordionWidget;
43  
44      /**
45       * {@inheritDoc}
46       */
47      @Override
48      public void performFinalize(Object model, LifecycleElement parent) {
49          super.performFinalize(model, parent);
50          this.addDataAttribute(UifConstants.DataAttributes.TYPE, "Uif-AccordionGroup");
51      }
52  
53      /**
54       * Only groups are supported for this group.
55       *
56       * {@inheritDoc}
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 accordion widget component used to render
68       * this AccordionGroup.
69       *
70       * @return the accordionWidget
71       */
72      @BeanTagAttribute
73      public Accordion getAccordionWidget() {
74          return this.accordionWidget;
75      }
76  
77      /**
78       * @see AccordionGroup#getAccordionWidget()
79       */
80      public void setAccordionWidget(Accordion accordionWidget) {
81          this.accordionWidget = accordionWidget;
82      }
83  }