Package pt.ist.fenixWebFramework.renderers.components

Examples of pt.ist.fenixWebFramework.renderers.components.HtmlTableRow


                int depth) {
            final HtmlTable groupTable = new HtmlTable();
            blockContainer.addChild(groupTable);
            groupTable.setClasses(getTablesClasses());
            groupTable.setStyle("width: " + (getInitialWidth() - depth) + "em; margin-left: " + depth + "em;");
            HtmlTableRow htmlTableRow = groupTable.createRow();
            htmlTableRow.setClasses(getGroupRowClasses());
            htmlTableRow.createCell().setBody(new HtmlText(degreeModuleToEnrol.getContext().getChildDegreeModule().getName()));
            HtmlTableCell checkBoxCell = htmlTableRow.createCell();
            checkBoxCell.setClasses("aright");

            HtmlCheckBox checkBox = new HtmlCheckBox(false);
            checkBox.setName("degreeModuleToEnrolCheckBox" + degreeModuleToEnrol.getContext().getExternalId() + ":"
                    + degreeModuleToEnrol.getCurriculumGroup().getExternalId());
View Full Code Here


            Collections.sort(coursesToEnrol, new BeanComparator("context"));

            for (DegreeModuleToEnrol degreeModuleToEnrol : coursesToEnrol) {
                CurricularCourse curricularCourse = (CurricularCourse) degreeModuleToEnrol.getContext().getChildDegreeModule();

                HtmlTableRow htmlTableRow = groupTable.createRow();
                HtmlTableCell cellName = htmlTableRow.createCell();
                cellName.setClasses(getCurricularCourseNameClasses());
                cellName.setBody(new HtmlText(curricularCourse.getName()));

                // Year
                final HtmlTableCell yearCell = htmlTableRow.createCell();
                yearCell.setClasses(getCurricularCourseYearClasses());
                yearCell.setColspan(2);

                final StringBuilder year = new StringBuilder();
                year.append(degreeModuleToEnrol.getContext().getCurricularPeriod().getFullLabel());
                yearCell.setBody(new HtmlText(year.toString()));

                if (!curricularCourse.isOptionalCurricularCourse()) {
                    // Ects
                    final HtmlTableCell ectsCell = htmlTableRow.createCell();
                    ectsCell.setClasses(getCurricularCourseEctsClasses());

                    final StringBuilder ects = new StringBuilder();
                    ects.append(curricularCourse.getEctsCredits()).append(" ")
                            .append(BundleUtil.getString(Bundle.ACADEMIC, "credits.abbreviation"));
                    ectsCell.setBody(new HtmlText(ects.toString()));

                    HtmlTableCell checkBoxCell = htmlTableRow.createCell();
                    checkBoxCell.setClasses(getCurricularCourseCheckBoxClasses());

                    HtmlCheckBox checkBox = new HtmlCheckBox(false);
                    checkBox.setName("degreeModuleToEnrolCheckBox" + degreeModuleToEnrol.getContext().getExternalId() + ":"
                            + degreeModuleToEnrol.getCurriculumGroup().getExternalId());
                    checkBox.setUserValue(degreeModuleToEnrol.getKey());
                    degreeModulesToEnrolController.addCheckBox(checkBox);
                    checkBoxCell.setBody(checkBox);
                } else {
                    final HtmlTableCell cell = htmlTableRow.createCell();
                    cell.setClasses(getCurricularCourseEctsClasses());
                    cell.setBody(new HtmlText(""));

                    HtmlTableCell linkTableCell = htmlTableRow.createCell();
                    linkTableCell.setClasses(getCurricularCourseCheckBoxClasses());

                    final HtmlLink htmlLink = new HtmlLink();
                    htmlLink.setText(BundleUtil.getString(Bundle.ACADEMIC, "link.option.choose.curricular.course"));
                    htmlLink.setUrl(getLinkURL());
View Full Code Here

                }
            }
        }

        private void generateEnrolment(final HtmlTable groupTable, Enrolment enrolment) {
            HtmlTableRow htmlTableRow = groupTable.createRow();
            HtmlTableCell cellName = htmlTableRow.createCell();
            cellName.setClasses(getEnrolmentNameClasses());
            cellName.setBody(new HtmlText(enrolment.getName().getContent()));

            // Year
            final HtmlTableCell yearCell = htmlTableRow.createCell();
            yearCell.setClasses(getEnrolmentYearClasses());

            final StringBuilder year = new StringBuilder();
            year.append(enrolment.getExecutionPeriod().getExecutionYear().getYear());
            yearCell.setBody(new HtmlText(year.toString()));

            // Semester
            final HtmlTableCell semesterCell = htmlTableRow.createCell();
            semesterCell.setClasses(getEnrolmentSemesterClasses());

            final StringBuilder semester = new StringBuilder();
            semester.append(enrolment.getExecutionPeriod().getSemester().toString());
            semester.append(" ");
            semester.append(BundleUtil.getString(Bundle.ENUMERATION, "SEMESTER.ABBREVIATION"));
            semesterCell.setBody(new HtmlText(semester.toString()));

            // Ects
            final HtmlTableCell ectsCell = htmlTableRow.createCell();
            ectsCell.setClasses(getEnrolmentEctsClasses());

            final StringBuilder ects = new StringBuilder();
            ects.append(enrolment.getCurricularCourse().getEctsCredits()).append(" ")
                    .append(BundleUtil.getString(Bundle.ACADEMIC, "credits.abbreviation"));
            ectsCell.setBody(new HtmlText(ects.toString()));

            MetaObject enrolmentMetaObject = MetaObjectFactory.createObject(enrolment, new Schema(Enrolment.class));

            HtmlCheckBox checkBox = new HtmlCheckBox(true);
            checkBox.setName("enrolmentCheckBox" + enrolment.getExternalId());
            checkBox.setUserValue(enrolmentMetaObject.getKey().toString());
            enrollmentsController.addCheckBox(checkBox);

            HtmlTableCell cellCheckBox = htmlTableRow.createCell();
            cellCheckBox.setClasses(getEnrolmentCheckBoxClasses());
            cellCheckBox.setBody(checkBox);
        }
View Full Code Here

                    return new HtmlText();
                }
                HtmlInlineContainer span = new HtmlInlineContainer();
                int rowIndex = 0;
                for (MetaObject meta : contacts) {
                    HtmlTableRow row = new HtmlTableRow();
                    row.setClasses(getRowClasses());
                    if (rowIndex == 0) {
                        HtmlTableCell left = row.createCell(CellType.HEADER);
                        left.setClasses(getLeftColumnClasses());
                        left.setStyle(getLeftLineStyle());
                        left.setRowspan(contacts.size());
                        left.setBody(new HtmlText(RenderUtils.getResourceString(getBundle(), getLabel()) + ":"));
                    }
                    HtmlTableCell right = row.createCell();
                    right.setClasses(getRightColumnClasses());
                    right.setStyle(getRightLineStyle());
                    right.setBody(getValue((PartyContact) meta.getObject()));
                    span.addChild(row);
                    rowIndex++;
View Full Code Here

                    }
                    courseContainer.addChild(groupName);
                    HtmlTable table = new HtmlTable();
                    for (CompetenceCourse course : group.getCurrentOrFutureCompetenceCourses()) {
                        if (course.getCurricularStage().equals(stage)) {
                            HtmlTableRow courseRow = table.createRow();
                            HtmlComponent coursePresentation =
                                    getCurrentOrFutureCoursePresentation(course, group, department.getDepartmentUnit());
                            if (getCourseNameClasses() != null) {
                                coursePresentation.setClasses(getCourseNameClasses());
                            }
                            courseRow.createCell().setBody(coursePresentation);
                            HtmlTableCell cell = courseRow.createCell();
                            cell.setBody(getLinks(course));
                            cell.setClasses("aright");
                        }
                    }
                    if (isShowOldCompetenceCourses()) {
                        for (CompetenceCourse course : group.getOldCompetenceCourses()) {
                            if (course.getCurricularStage().equals(stage)) {
                                HtmlTableRow courseRow = table.createRow();
                                HtmlComponent coursePresentation = getOldCoursePresentation(course);
                                if (getCourseNameClasses() != null) {
                                    coursePresentation.setClasses(getCourseNameClasses());
                                }
                                courseRow.createCell().setBody(coursePresentation);
                                HtmlTableCell cell = courseRow.createCell();
                                cell.setBody(getLinks(course));
                                cell.setClasses("aright");
                            }
                        }
                    }
View Full Code Here

TOP

Related Classes of pt.ist.fenixWebFramework.renderers.components.HtmlTableRow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.