@Override
public HtmlComponent createComponent(Object object, Class type) {
this.curriculum = (Curriculum) object;
final HtmlContainer container = new HtmlBlockContainer();
if (this.curriculum == null) {
container.addChild(createHtmlTextItalic(BundleUtil.getString(Bundle.STUDENT, "message.no.average")));
return container;
}
if (!this.curriculum.getStudentCurricularPlan().isBoxStructure()) {
container.addChild(createHtmlTextItalic(BundleUtil.getString(Bundle.STUDENT, "not.applicable")));
return container;
}
if (this.curriculum.isEmpty()) {
container.addChild(createHtmlTextItalic(BundleUtil.getString(Bundle.STUDENT, "message.no.approvals")));
return container;
}
if (this.curriculum.getCurriculumEntries().isEmpty()) {
container.addChild(createHtmlTextItalic(BundleUtil.getString(Bundle.STUDENT, "message.empty.curriculum")));
} else {
final HtmlContainer averageContainer = new HtmlBlockContainer();
averageContainer.setStyle("padding-bottom: 3.5em;");
container.addChild(averageContainer);
final HtmlTable averageEntriesTable = new HtmlTable();
averageContainer.addChild(averageEntriesTable);
averageEntriesTable.setClasses(getTableClass());
generateAverageRows(averageEntriesTable);
generateAverageSums(averageEntriesTable);
}
if (isVisibleCurricularYearEntries()) {
final HtmlContainer curricularYearContainer = new HtmlBlockContainer();
container.addChild(curricularYearContainer);
final HtmlTable curricularYearTable = new HtmlTable();
curricularYearContainer.addChild(curricularYearTable);
curricularYearTable.setClasses(getTableClass());
generateCurricularYearRows(curricularYearTable);
generateCurricularYearSums(curricularYearTable);
}