Package pt.ist.fenixWebFramework.renderers.components

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


            }
        }

        private void generateCurricularYearHeaderRowWithText(final HtmlTable table, final String text, boolean addHeaders,
                final int level) {
            final HtmlTableRow groupRow = table.createRow();
            groupRow.setClasses(getHeaderRowClass());

            final HtmlTableCell textCell = groupRow.createCell();
            textCell.setText(text);
            textCell.setClasses(getLabelCellClass());
            textCell.setRowspan(2);
            textCell.setColspan(MAX_COL_SPAN_FOR_TEXT_ON_CURRICULUM_LINES);

            final HtmlTableCell curricularYearCell = groupRow.createCell();
            curricularYearCell.setText("Ano Curricular");
            curricularYearCell.setClasses(getGradeCellClass());
            curricularYearCell.setColspan(1);

            final HtmlTableCell executionYearCell = groupRow.createCell();
            executionYearCell.setText("Ano Lectivo");
            executionYearCell.setClasses(getGradeCellClass());
            executionYearCell.setColspan(2);
            executionYearCell.setRowspan(2);

            final HtmlTableRow groupSubRow = table.createRow();
            groupSubRow.setClasses(getHeaderRowClass());
            generateCellWithText(groupSubRow, BundleUtil.getString(Bundle.APPLICATION, "label.ects"), getEctsCreditsCellClass());
        }
View Full Code Here


            }
        }

        private void generateCurricularYearRow(HtmlTable mainTable, final ICurriculumEntry entry, int level,
                boolean allowSelection) {
            final HtmlTableRow enrolmentRow = mainTable.createRow();
            enrolmentRow.setClasses(getEnrolmentRowClass());

            generateCodeAndNameCell(enrolmentRow, entry, level, allowSelection);
            if (entry instanceof ExternalEnrolment) {
                generateExternalEnrolmentLabelCell(enrolmentRow, (ExternalEnrolment) entry, level);
            }
View Full Code Here

            generateExecutionYearCell(enrolmentRow, entry);
            generateSemesterCell(enrolmentRow, entry);
        }

        private void generateCurricularYearSums(final HtmlTable mainTable) {
            final HtmlTableRow row = mainTable.createRow();
            row.setClasses(getHeaderRowClass());

            final HtmlTableCell sumsCell = row.createCell();
            sumsCell.setText("Somatórios");
            sumsCell.setStyle("text-align: right;");
            sumsCell.setColspan(14);

            final HtmlTableCell sumEctsCreditsCell = row.createCell();
            sumEctsCreditsCell.setText(this.curriculum.getSumEctsCredits().toString());
            sumEctsCreditsCell.setClasses(getGradeCellClass());

            final HtmlTableCell emptyCell = row.createCell();
            emptyCell.setClasses(getGradeCellClass());
            emptyCell.setColspan(2);
        }
View Full Code Here

            final HtmlTable groupTable = new HtmlTable();
            blockContainer.addChild(groupTable);
            groupTable.setClasses(getTablesClasses());
            groupTable.setStyle("width: " + (getInitialWidth() - depth) + "em; margin-left: " + depth + "em;");

            final HtmlTableRow htmlTableRow = groupTable.createRow();
            htmlTableRow.setClasses(getGroupRowClasses());
            htmlTableRow.createCell().setBody(new HtmlText(courseGroup.getName()));

            final List<Context> childCourseGroupContexts =
                    courseGroup.getValidChildContexts(CourseGroup.class, getExecutionSemester());
            final List<Context> childCurricularCourseContexts =
                    courseGroup.getValidChildContexts(CurricularCourse.class, getExecutionSemester());
View Full Code Here

            for (Context context : contexts) {
                final CurricularCourse curricularCourse = (CurricularCourse) context.getChildDegreeModule();

                if (!curricularCourse.isOptionalCurricularCourse()) {

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

                    // Year
                    final HtmlTableCell yearCell = htmlTableRow.createCell();
                    yearCell.setClasses(getCurricularCourseYearClasses());
                    yearCell.setBody(new HtmlText(context.getCurricularPeriod().getFullLabel()));

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

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

                    // enrolment link
                    final HtmlTableCell linkTableCell = htmlTableRow.createCell();
                    linkTableCell.setClasses(getCurricularCourseLinkClasses());

                    final HtmlActionLink actionLink = new HtmlActionLink();
                    actionLink.setText(BundleUtil.getString(Bundle.ACADEMIC, "link.option.enrol.curricular.course"));
                    actionLink.setName("curricularCourseEnrolLink" + curricularCourse.getExternalId());
View Full Code Here

            final HtmlTable groupTable = new HtmlTable();
            container.addChild(groupTable);
            groupTable.setClasses(getTablesClasses());
            groupTable.setStyle("width: " + (getInitialWidth() - depth) + "em; margin-left: " + depth + "em;");

            final HtmlTableRow htmlTableRow = groupTable.createRow();
            htmlTableRow.setClasses(getGroupRowClasses());
            String name = branch.getName().trim();
            if (name.length() == 0) {
                name = "Tronco Comum";
            }
            htmlTableRow.createCell().setBody(new HtmlText(name));

            generateBranchScopes(container, scopes, depth + getWidthDecreasePerLevel());
        }
View Full Code Here

            container.addChild(table);
            table.setClasses(getTablesClasses());
            table.setStyle("width: " + (getInitialWidth() - depth) + "em; margin-left: " + depth + "em;");

            for (DegreeModuleScope scope : scopes) {
                final HtmlTableRow htmlTableRow = table.createRow();
                HtmlTableCell cellName = htmlTableRow.createCell();
                cellName.setClasses(getCurricularCourseNameClasses());
                cellName.setBody(new HtmlText(scope.getCurricularCourse().getName(getExecutionSemester())));

                // Year
                final HtmlTableCell yearCell = htmlTableRow.createCell();
                yearCell.setClasses(getCurricularCourseYearClasses());
                yearCell.setBody(new HtmlText(RenderUtils.getResourceString("ACADEMIC_OFFICE_RESOURCES",
                        "label.scope.curricular.semester",
                        new Object[] { scope.getCurricularYear(), scope.getCurricularSemester() })));

                // Ects
                final HtmlTableCell ectsCell = htmlTableRow.createCell();
                ectsCell.setClasses(getCurricularCourseEctsClasses());
                final StringBuilder ects = new StringBuilder();
                ects.append(scope.getCurricularCourse().getEctsCredits(getExecutionSemester())).append(" ")
                        .append(BundleUtil.getString(Bundle.ACADEMIC, "credits.abbreviation"));
                ectsCell.setBody(new HtmlText(ects.toString()));

                // enrolment link
                final HtmlTableCell linkTableCell = htmlTableRow.createCell();
                linkTableCell.setClasses(getCurricularCourseLinkClasses());

                final HtmlActionLink actionLink = new HtmlActionLink();
                actionLink.setText(BundleUtil.getString(Bundle.ACADEMIC, "link.option.enrol.curricular.course"));
                actionLink.setName("curricularCourseEnrolLink" + scope.getCurricularCourse().getExternalId());
View Full Code Here

            return container;
        }

        private HtmlTable createPersonalCard(Person person, Class type) {
            HtmlTable table = new HtmlTable();
            HtmlTableRow row = table.createRow();
            HtmlTableCell imageCell = row.createCell();
            imageCell.setClasses(getPhotoCellClasses());
            imageCell.setBody(createImageContainer(person));
            HtmlTableCell dataCell = row.createCell();
            dataCell.setBody(createInformationList(person, type));
            dataCell.setClasses(getInfoCellClasses());
            return table;
        }
View Full Code Here

                rowSpan = 1;
            } else {
                rowSpan = 2;
            }

            HtmlTableRow row1 = tableHeader.createRow();
            if (bean.getViewPhoto()) {
                HtmlTableCell photoCell = row1.createCell(BundleUtil.getString(Bundle.APPLICATION, "label.photo"));
                photoCell.setRowspan(rowSpan);
            }
            HtmlTableCell usernameCell = row1.createCell(BundleUtil.getString(Bundle.APPLICATION, "label.username"));
            usernameCell.setRowspan(rowSpan);

            HtmlTableCell numberCell = row1.createCell(BundleUtil.getString(Bundle.APPLICATION, "label.number"));
            numberCell.setRowspan(rowSpan);

            HtmlTableCell numberOfEnrolmentsCell =
                    row1.createCell(BundleUtil.getString(Bundle.APPLICATION, "label.numberOfEnrollments"));
            numberOfEnrolmentsCell.setRowspan(rowSpan);

            HtmlTableCell enrolmentStateCell1 =
                    row1.createCell(BundleUtil.getString(Bundle.APPLICATION, "label.attends.enrollmentState"));
            enrolmentStateCell1.setRowspan(rowSpan);

            HtmlTableCell degreeCell = row1.createCell(BundleUtil.getString(Bundle.APPLICATION, "label.Degree"));
            degreeCell.setRowspan(rowSpan);

            HtmlTableCell registrationStateCell =
                    row1.createCell(BundleUtil.getString(Bundle.APPLICATION, "label.registration.state"));
            registrationStateCell.setRowspan(rowSpan);

            HtmlTableCell nameCell = row1.createCell(BundleUtil.getString(Bundle.APPLICATION, "label.name"));
            nameCell.setRowspan(rowSpan);

            if (!groupings.isEmpty()) {
                HtmlTableCell groupingCell = row1.createCell(BundleUtil.getString(Bundle.APPLICATION, "label.projectGroup"));
                groupingCell.setColspan(groupings.size());
            }

            HtmlTableCell emailCell = row1.createCell(BundleUtil.getString(Bundle.APPLICATION, "label.mail"));
            emailCell.setRowspan(rowSpan);

            if (!shiftTypes.isEmpty()) {
                HtmlTableCell shiftCell = row1.createCell(BundleUtil.getString(Bundle.APPLICATION, "label.attends.shifts"));
                shiftCell.setColspan(shiftTypes.size());
            }

            HtmlTableRow row2 = tableHeader.createRow();
            for (Grouping grouping : groupings) {
                row2.createCell(grouping.getName());
            }
            for (ShiftType shiftType : shiftTypes) {
                row2.createCell(BundleUtil.getString(Bundle.ENUMERATION, shiftType.getName()));
            }

            List<Attends> attendsResult = new ArrayList<Attends>(bean.getAttendsResult());
            Collections.sort(attendsResult, Attends.COMPARATOR_BY_STUDENT_NUMBER);
            for (Attends attends : attendsResult) {
                HtmlTableRow row = htmlTable.createRow();
                if (bean.getViewPhoto()) {
                    HtmlImage htmlImage = new HtmlImage();
                    htmlImage.setSource(RenderUtils.getContextRelativePath("") + "/user/photo/"
                            + attends.getRegistration().getStudent().getPerson().getUsername());
                    row.createCell().setBody(htmlImage);
                }
                row.createCell(attends.getRegistration().getStudent().getPerson().getUsername());
                row.createCell(attends.getRegistration().getNumber().toString());
                if (attends.getEnrolment() == null) {
                    row.createCell("--");
                } else {
                    row.createCell(String.valueOf(attends.getEnrolment().getNumberOfTotalEnrolmentsInThisCourse(
                            attends.getEnrolment().getExecutionPeriod())));
                }

                final StudentAttendsStateType stateType = attends.getAttendsStateType();
                row.createCell(stateType != null ? BundleUtil.getString(Bundle.ENUMERATION, stateType.getQualifiedName()) : "--");
                row.createCell(attends.getStudentCurricularPlanFromAttends().getDegreeCurricularPlan().getName());
                final RegistrationState registrationState =
                        attends.getRegistration().getLastRegistrationState(attends.getExecutionYear());
                row.createCell(registrationState == null ? "" : registrationState.getStateType().getDescription());
                row.createCell(attends.getRegistration().getStudent().getPerson().getFirstAndLastName());

                for (Grouping grouping : groupings) {
                    StudentGroup studentGroup = attends.getStudentGroupByGrouping(grouping);
                    if (studentGroup == null) {
                        row.createCell("N/A");
                    } else {
                        HtmlLink groupLink = new HtmlLink();
                        groupLink.setText(studentGroup.getGroupNumber().toString());
                        groupLink.setUrl(getGroupURL(studentGroup));
                        row.createCell().setBody(groupLink);
                    }
                }

                String email = attends.getRegistration().getStudent().getPerson().getEmail();
                row.createCell().setBody(email != null ? new HtmlEMailLink(email) : new HtmlLabel(""));

                for (ShiftType shiftType : shiftTypes) {
                    Shift shift = attends.getRegistration().getShiftFor(bean.getExecutionCourse(), shiftType);
                    if (shift == null) {
                        row.createCell("N/A");
                    } else {
                        row.createCell(shift.getNome());
                    }
                }
            }

            return htmlTable;
View Full Code Here

            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(curriculumModuleBean.getCurriculumModule().getName().getContent()));

            HtmlTableCell checkBoxCell = htmlTableRow.createCell();
            checkBoxCell.setClasses("aright");

            HtmlCheckBox checkBox = new HtmlCheckBox(true);
            MetaObject enrolmentMetaObject =
                    MetaObjectFactory.createObject(curriculumModuleBean.getCurriculumModule(), new Schema(CurriculumGroup.class));
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.