private void addSuperSections(
      ISIXmlSection currentSection,
      ISIXmlSection rootSection,
      RepeatingView superSectionRepeater,
      SectionIconFactory iconFactory) {
    // We do have supersections
    for (XmlSection ss : rootSection.getChildren()) {
      ISIXmlSection superSection = (ISIXmlSection) ss;
      WebMarkupContainer superSectionContainer =
          new WebMarkupContainer(superSectionRepeater.newChildId());
      superSectionRepeater.add(superSectionContainer);

      superSectionContainer.add(new Label("superSectionTitle", superSection.getTitle()));

      List<XmlSection> sections;
      // Use Supersection children, or supersection itself if there are no children.
      if (!superSection.hasChildren()) {
        sections = new ArrayList<XmlSection>();
        sections.add(superSection);
      } else {
        sections = superSection.getChildren();
      }

      superSectionContainer.add(
          new SectionRepeater("sectionRepeater", sections, currentSection, iconFactory));
    }
  }
 private void addSimpleSections(
     ISIXmlSection currentSection,
     ISIXmlSection rootSection,
     RepeatingView superSectionRepeater,
     SectionIconFactory iconFactory) {
   // Simple case - no supersection.  Create a single container and put sections into it.
   WebMarkupContainer container = new WebMarkupContainer(superSectionRepeater.newChildId());
   superSectionRepeater.add(container);
   container.add(new EmptyPanel("superSectionTitle"));
   container.add(
       new SectionRepeater(
           "sectionRepeater", rootSection.getChildren(), currentSection, iconFactory));
 }