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));
}
}