View Javadoc
1   /**
2    * Copyright 2005-2014 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  @BeanTags({@BeanTag(name = "accordionGroup-bean", parent = "Uif-AccordionGroup"),
33          @BeanTag(name = "accordionSection-bean", parent = "Uif-AccordionSection"),
34          @BeanTag(name = "accordionSubSection-bean", parent = "Uif-AccordionSubSection"),
35          @BeanTag(name = "disclosure-accordionSection-bean", parent = "Uif-Disclosure-AccordionSection"),
36          @BeanTag(name = "disclosure-accordionSubSection-bean", parent = "Uif-Disclosure-AccordionSubSection")})
37  public class AccordionGroup extends GroupBase {
38  
39      private static final long serialVersionUID = 7230145606607506418L;
40  
41      private Accordion accordionWidget;
42  
43      /**
44       * {@inheritDoc}
45       */
46      @Override
47      public void performFinalize(Object model, LifecycleElement parent) {
48          super.performFinalize(model, parent);
49          this.addDataAttribute(UifConstants.DataAttributes.TYPE, "Uif-AccordionGroup");
50      }
51  
52      /**
53       * Only groups are supported for this group.
54       *
55       * {@inheritDoc}
56       */
57      @Override
58      public Set<Class<? extends Component>> getSupportedComponents() {
59          Set<Class<? extends Component>> supportedComponents = new HashSet<Class<? extends Component>>();
60          supportedComponents.add(Group.class);
61  
62          return supportedComponents;
63      }
64  
65      /**
66       * Gets the widget which contains any configuration for the accordion widget component used to render
67       * this AccordionGroup.
68       *
69       * @return the accordionWidget
70       */
71      @BeanTagAttribute(name = "accordionWidget", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
72      public Accordion getAccordionWidget() {
73          return this.accordionWidget;
74      }
75  
76      /**
77       * Set the accordionWidget.
78       *
79       * @param accordionWidget the accordionWidget to set
80       */
81      public void setAccordionWidget(Accordion accordionWidget) {
82          this.accordionWidget = accordionWidget;
83      }
84  }