@Override public void onBeforeRender() { ISIXmlSection currentSection = getCurrentSection(); ISIXmlSection rootSection = ISIXmlSection.getRootSection(currentSection); /** ************************ Super Section Repeater * ************************ */ RepeatingView superSectionRepeater = new RepeatingView("superSectionRepeater"); addOrReplace(superSectionRepeater); // Determine if there is a super-section level, or if we just have a list of regular sections if (rootSection.hasSuperSections()) { addSuperSections(currentSection, rootSection, superSectionRepeater, iconFactory); } else { addSimpleSections(currentSection, rootSection, superSectionRepeater, iconFactory); } super.onBeforeRender(); }
/** * Construct nav bar based on a certain page that is currently being displayed. * * @param id * @param mCurrentPage - model of the XmlSection that is the current page. * @param teacher if true, a version of the nav bar appropriate for the teacher is produced. */ public DefaultNavBar(String id, IModel<XmlSection> mCurrentPage, boolean teacher) { super(id, mCurrentPage); setOutputMarkupId(true); iconFactory = SectionIconFactory.getIconFactory(teacher); if (mCurrentPage == null) { setModel(new XmlSectionModel(ISIApplication.get().getPageNum(1))); } ISIXmlSection rootSection = ISIXmlSection.getRootSection(getCurrentSection()); // Current Section's Page Repeater with prev/next PageNavPanel pageNavPanelTop = new PageNavPanel("pageNavPanelTop", getModel()); add(pageNavPanelTop); /** ******* Other * ******* */ // Jump to a certain page add(new QuickFlipForm("quickFlipForm", true)); // Chapter Title (xml level 1) add(new Label("title", rootSection.getTitle())); }