Package pt.ist.fenixWebFramework.renderers.components

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


        @Override
        public HtmlComponent createComponent(Object object, Class type) {
            Person person = (Person) object;
            HtmlBlockContainer container = new HtmlBlockContainer();
            container.setClasses(getClasses());
            HtmlTable table = createPersonalCard(person, type);
            container.addChild(table);
            return container;
        }
View Full Code Here


            container.addChild(table);
            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));
View Full Code Here

        }

        protected void generateNoCourseGroupCurriculumGroup(HtmlBlockContainer container,
                StudentCurricularPlan studentCurricularPlan, CurriculumGroup curriculumGroup, int depth) {
            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());

            final HtmlTableCell nameCell = htmlTableRow.createCell();
            nameCell.setBody(new HtmlText(curriculumGroup.getFullPath()));
            nameCell.setClasses(getGroupNameClasses());
View Full Code Here

                    .getCycleCourseGroup(cycleType);
        }

        protected void generateCurricularCourses(final HtmlBlockContainer blockContainer,
                final StudentCurricularPlan studentCurricularPlan, final ExecutionSemester executionSemester) {
            final HtmlTable groupTable = new HtmlTable();
            blockContainer.addChild(groupTable);
            groupTable.setClasses(getTablesClasses());
            groupTable.setStyle("width: " + getInitialWidth() + "em; margin-left: 0em;");

            final List<CurricularCourse> orderedCurricularCourses =
                    new ArrayList<CurricularCourse>(dismissalBean.getAllCurricularCoursesToDismissal());
            Collections.sort(orderedCurricularCourses, new BeanComparator("name", Collator.getInstance()));

            for (final CurricularCourse curricularCourse : orderedCurricularCourses) {
                final HtmlTableRow htmlTableRow = groupTable.createRow();
                htmlTableRow.setClasses(getCurricularCourseRowClasses());

                final HtmlTableCell nameCell = htmlTableRow.createCell();

                final String code = curricularCourse.getCode();
View Full Code Here

        }

        protected void generateCourseGroups(final HtmlBlockContainer blockContainer,
                final StudentCurricularPlan studentCurricularPlan, final CourseGroup courseGroup,
                final ExecutionSemester executionSemester, int depth) {
            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());

            final HtmlTableCell nameCell = htmlTableRow.createCell();
            nameCell.setBody(new HtmlText(courseGroup.getName()));
            nameCell.setClasses(getGroupNameClasses());
View Full Code Here

            stringBuilder.append("&groupPropertiesCode=" + studentGroup.getGrouping().getExternalId());
            return stringBuilder.toString();
        }

        private HtmlTable renderAttendsList() {
            HtmlTable htmlTable = new HtmlTable();
            htmlTable.setClasses(getAttendsListTableClasses());
            HtmlTableHeader tableHeader = htmlTable.createHeader();

            List<Grouping> groupings = new ArrayList<Grouping>(bean.getExecutionCourse().getGroupings());
            Collections.sort(groupings, Grouping.COMPARATOR_BY_ENROLMENT_BEGIN_DATE);

            List<ShiftType> shiftTypes = new ArrayList<ShiftType>(bean.getExecutionCourse().getShiftTypes());
            Collections.sort(shiftTypes);

            Integer rowSpan;
            if (groupings.isEmpty() && shiftTypes.isEmpty()) {
                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);
View Full Code Here

            return container;
        }

        private void generateModules(HtmlBlockContainer blockContainer, StudentCurricularPlan studentCurricularPlan,
                CurriculumModuleBean curriculumModuleBean, ExecutionSemester executionSemester, 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(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));
            checkBox.setName("enrolmentCheckBox" + curriculumModuleBean.getCurriculumModule().getExternalId());
            checkBox.setUserValue(enrolmentMetaObject.getKey().toString());
            checkBoxCell.setBody(checkBox);

            if (!curriculumModuleBean.getGroupsEnroled().isEmpty()
                    || !curriculumModuleBean.getCurricularCoursesEnroled().isEmpty()) {
                checkBox.setDisabled(true);
            } else {
                enrollmentsController.addCheckBox(checkBox);
            }

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

            generateEnrolments(curriculumModuleBean, executionSemester, coursesTable);
            generateCurricularCoursesToEnrol(coursesTable, curriculumModuleBean, executionSemester);
            generateGroups(blockContainer, curriculumModuleBean, studentCurricularPlan, executionSemester, depth);
View Full Code Here

            }
        }

        private void generateCourseGroupToEnroll(HtmlBlockContainer blockContainer, DegreeModuleToEnrol degreeModuleToEnrol,
                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");
View Full Code Here

                    HtmlText groupName = new HtmlText(group.getPresentationName());
                    if (getGroupNameClasses() != null) {
                        groupName.setClasses(getGroupNameClasses());
                    }
                    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");
                            }
                        }
                    }
                    courseContainer.addChild(table);
                    if (getTableClasses() != null) {
                        table.setClasses(getTableClasses());
                    }

                    item.setBody(courseContainer);
                }
                listContainer.addChild(areaName);
View Full Code Here

TOP

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

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.