Package pt.ist.fenixWebFramework.renderers.components

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


            final ExecutionSemester executionSemester) {

        final HtmlTableRow groupHeaderRow = groupTable.createRow();
        groupHeaderRow.setClasses(getRenderer().getGroupRowClasses());

        final HtmlTableCell titleCell = groupHeaderRow.createCell();
        if (studentCurriculumGroupBean.getCurriculumModule().isRoot()) {
            if (studentCurriculumGroupBean.getCurriculumModule().getDegreeCurricularPlanOfStudent().isEmpty()) {
                titleCell.setBody(new HtmlText(studentCurriculumGroupBean.getCurriculumModule().getName().getContent()));
            } else {
                titleCell.setBody(createDegreeCurricularPlanLink(studentCurriculumGroupBean));
            }
        } else if (studentCurriculumGroupBean.getCurriculumModule().isCycleCurriculumGroup()) {
            setTitleCellInformation(groupHeaderRow, titleCell, studentCurriculumGroupBean, executionSemester);

        } else {
            titleCell.setBody(new HtmlText(buildCurriculumGroupLabel(studentCurriculumGroupBean.getCurriculumModule(),
                    executionSemester), false));
        }

        final HtmlTableCell checkBoxCell = groupHeaderRow.createCell();
        checkBoxCell.setClasses("aright");

        final HtmlCheckBox checkBox = new HtmlCheckBox(true) {
            @Override
            public void setChecked(boolean checked) {
                if (isDisabled()) {
                    super.setChecked(true);
                } else {
                    super.setChecked(checked);
                }
            }
        };

        MetaObject enrolmentMetaObject =
                MetaObjectFactory.createObject(studentCurriculumGroupBean.getCurriculumModule(),
                        new Schema(CurriculumGroup.class));
        checkBox.setName("enrolmentCheckBox" + studentCurriculumGroupBean.getCurriculumModule().getExternalId());
        checkBox.setUserValue(enrolmentMetaObject.getKey().toString());
        checkBoxCell.setBody(checkBox);

        if (studentCurriculumGroupBean.isToBeDisabled()) {
            checkBox.setDisabled(true);
        } else {
            enrollmentsController.addCheckBox(checkBox);
View Full Code Here


        cell.setTitle(getLabel("label.degreeCurricularPlan.renderer.title.course.load"));
    }

    private void drawEctsCredits(final CurricularCourse course, final CurricularPeriod period, final ExecutionSemester interval,
            final HtmlTableRow row) {
        final HtmlTableCell cell = row.createCell();
        cell.setClasses(getEctsCreditsCellClass());
        cell.setText(course.isOptionalCurricularCourse() ? EMPTY_CELL : course.getEctsCredits(period, interval).toString());
    }
View Full Code Here

    protected void generateCurricularCoursesToEnrol(HtmlTable groupTable, StudentCurriculumGroupBean studentCurriculumGroupBean) {
        final List<IDegreeModuleToEvaluate> coursesToEvaluate = studentCurriculumGroupBean.getSortedDegreeModulesToEvaluate();

        for (final IDegreeModuleToEvaluate degreeModuleToEvaluate : coursesToEvaluate) {
            HtmlTableRow htmlTableRow = groupTable.createRow();
            HtmlTableCell cellName = htmlTableRow.createCell();
            cellName.setClasses(getRenderer().getCurricularCourseToEnrolNameClasses());

            String degreeName = degreeModuleToEvaluate.getName();

            if (canPerformStudentEnrolments && degreeModuleToEvaluate.getDegreeModule() instanceof CurricularCourse) {
                if (!StringUtils.isEmpty(degreeModuleToEvaluate.getDegreeModule().getCode())) {
                    degreeName = degreeModuleToEvaluate.getDegreeModule().getCode() + " - " + degreeName;
                }

                CurricularCourse curricularCourse = (CurricularCourse) degreeModuleToEvaluate.getDegreeModule();
                degreeName +=
                        " (" + BundleUtil.getString(Bundle.STUDENT, "label.grade.scale") + " - "
                                + curricularCourse.getGradeScaleChain().getDescription() + ") ";
            }

            cellName.setBody(new HtmlText(degreeName));

            // Year
            final HtmlTableCell yearCell = htmlTableRow.createCell();
            yearCell.setClasses(getRenderer().getCurricularCourseToEnrolYearClasses());
            yearCell.setColspan(2);
            yearCell.setBody(new HtmlText(degreeModuleToEvaluate.getYearFullLabel()));

            if (!degreeModuleToEvaluate.isOptionalCurricularCourse()) {
                // Ects
                final HtmlTableCell ectsCell = htmlTableRow.createCell();
                ectsCell.setClasses(getRenderer().getCurricularCourseToEnrolEctsClasses());

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

                HtmlTableCell checkBoxCell = htmlTableRow.createCell();
                checkBoxCell.setClasses(getRenderer().getCurricularCourseToEnrolCheckBoxClasses());

                HtmlCheckBox checkBox = new HtmlCheckBox(false);
                checkBox.setName("degreeModuleToEnrolCheckBox" + degreeModuleToEvaluate.getKey());
                checkBox.setUserValue(degreeModuleToEvaluate.getKey());
                getDegreeModulesToEvaluateController().addCheckBox(checkBox);
                checkBoxCell.setBody(checkBox);
            } else {
                final HtmlTableCell cell = htmlTableRow.createCell();
                cell.setClasses(getRenderer().getCurricularCourseToEnrolEctsClasses());
                cell.setBody(new HtmlText(""));

                HtmlTableCell linkTableCell = htmlTableRow.createCell();
                linkTableCell.setClasses(getRenderer().getCurricularCourseToEnrolCheckBoxClasses());

                final HtmlActionLink actionLink = new HtmlActionLink();
                actionLink.setText(BundleUtil.getString(Bundle.STUDENT, "label.chooseOptionalCurricularCourse"));
                actionLink.setController(new OptionalCurricularCourseLinkController(degreeModuleToEvaluate));
                actionLink
                        .setOnClick("$(this).closest('form').find('input[name=\\'method\\']').attr('value', 'prepareChooseOptionalCurricularCourseToEnrol');");
                //actionLink.setOnClick("document.forms[2].method.value='prepareChooseOptionalCurricularCourseToEnrol';");
                actionLink.setName("optionalCurricularCourseLink" + degreeModuleToEvaluate.getCurriculumGroup().getExternalId()
                        + "_" + degreeModuleToEvaluate.getContext().getExternalId());
                linkTableCell.setBody(actionLink);
            }

            if (getRenderer().isEncodeCurricularRules()) {
                encodeCurricularRules(groupTable, degreeModuleToEvaluate);
            }
View Full Code Here

    protected void encodeCurricularRules(final HtmlTable groupTable, final List<CurricularRule> curricularRules) {
        final HtmlTableRow htmlTableRow = groupTable.createRow();

        final HtmlTable rulesTable = new HtmlTable();
        final HtmlTableCell cellRules = htmlTableRow.createCell();

        cellRules.setClasses(getRenderer().getCurricularCourseToEnrolNameClasses());
        cellRules.setBody(rulesTable);
        cellRules.setColspan(5);

        rulesTable.setClasses("smalltxt noborder");
        rulesTable.setStyle("width: 100%;");

        for (final CurricularRule curricularRule : curricularRules) {
            final HtmlTableCell cellName = rulesTable.createRow().createCell();
            cellName.setStyle("color: #888");
            cellName.setBody(new HtmlText(CurricularRuleLabelFormatter.getLabel(curricularRule, I18N.getLocale())));
        }
    }
View Full Code Here

    protected void generateEnrolment(final HtmlTable groupTable, Enrolment enrolment, final String enrolmentNameClasses,
            final String enrolmentYearClasses, final String enrolmentSemesterClasses, final String enrolmentEctsClasses,
            final String enrolmentCheckBoxClasses) {
        HtmlTableRow htmlTableRow = groupTable.createRow();
        HtmlTableCell cellName = htmlTableRow.createCell();
        cellName.setClasses(enrolmentNameClasses);

        String enrolmentName = getPresentationNameFor(enrolment);
        if (canPerformStudentEnrolments && enrolment.getDegreeModule() instanceof CurricularCourse) {
            CurricularCourse curricularCourse = (CurricularCourse) enrolment.getDegreeModule();

            if (!StringUtils.isEmpty(curricularCourse.getCode())) {
                enrolmentName = curricularCourse.getCode() + " - " + enrolmentName;
            }

            enrolmentName +=
                    " (" + BundleUtil.getString(Bundle.STUDENT, "label.grade.scale") + " - "
                            + curricularCourse.getGradeScaleChain().getDescription() + ") ";
        }

        cellName.setBody(new HtmlText(enrolmentName));

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

        final String year = enrolment.getExecutionPeriod().getExecutionYear().getYear();
        yearCell.setBody(new HtmlText(year));

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

        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(enrolmentEctsClasses);

        final StringBuilder ects = new StringBuilder();
        final double ectsCredits =
                (enrolment.isBolonhaDegree() && getBolonhaStudentEnrollmentBean().getCurricularRuleLevel().isNormal()) ? enrolment
                        .getAccumulatedEctsCredits(enrolment.getExecutionPeriod()) : enrolment.getEctsCredits();
        ects.append(ectsCredits).append(" ").append(BundleUtil.getString(Bundle.STUDENT, "label.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(enrolmentCheckBoxClasses);
        cellCheckBox.setBody(checkBox);
    }
View Full Code Here

        final HtmlTable groupTable = createGroupTable(blockContainer, depth);

        HtmlTableRow htmlTableRow = groupTable.createRow();
        htmlTableRow.setClasses(getRenderer().getGroupRowClasses());
        htmlTableRow.createCell().setBody(new HtmlText(degreeModuleToEnrol.getContext().getChildDegreeModule().getName()));
        HtmlTableCell cell = htmlTableRow.createCell();
        cell.setClasses("aright");

        HtmlCheckBox checkBox = new HtmlCheckBox(false);
        final String name =
                "degreeModuleToEnrolCheckBox" + degreeModuleToEnrol.getContext().getExternalId().toString() + ":"
                        + degreeModuleToEnrol.getCurriculumGroup().getExternalId().toString();
        checkBox.setName(name);
        checkBox.setUserValue(degreeModuleToEnrol.getKey());
        getDegreeModulesToEvaluateController().addCheckBox(checkBox);
        cell.setBody(checkBox);

        if (getRenderer().isEncodeGroupRules()) {
            encodeCurricularRules(groupTable, degreeModuleToEnrol);
        }
    }
View Full Code Here

        final HtmlTable groupTable = createGroupTable(container, depth);
        HtmlTableRow htmlTableRow = groupTable.createRow();
        htmlTableRow.setClasses(getRenderer().getGroupRowClasses());
        htmlTableRow.createCell().setBody(new HtmlText(RenderUtils.getEnumString(cycleType)));
        HtmlTableCell cell = htmlTableRow.createCell();
        cell.setClasses("aright");

        final HtmlActionLink actionLink = new HtmlActionLink();
        actionLink.setText(BundleUtil.getString(Bundle.STUDENT, "label.choose"));
        actionLink.setController(new CycleSelectionLinkController(cycleType));
        actionLink
                .setOnClick("(function (z){var node = z; while(node.tagName != 'FORM'){ node = node.parentNode; } return node;})(this).method.value='prepareChooseCycleCourseGroupToEnrol';");
        actionLink.setName("cycleLink_" + cycleType.name());
        cell.setBody(actionLink);

    }
View Full Code Here

            createDCPSearch(row, headerRow);
            createShiftSearch(row, headerRow);
            createWorkingStudentSearch(row, headerRow);

            HtmlTableRow row2 = htmlTable.createRow();
            HtmlTableCell photoCell = row2.createCell();
            photoCell.setColspan(headerRow.getCells().size());
            HtmlCheckBox checkBox =
                    new HtmlCheckBox(BundleUtil.getString(Bundle.APPLICATION, "label.viewPhoto"), bean.getViewPhoto());
            checkBox.bind(getInputContext().getMetaObject(), "viewPhoto");
            photoCell.setBody(checkBox);

            HtmlTableRow row3 = htmlTable.createRow();
            HtmlTableCell submitCell = row3.createCell();
            submitCell.setColspan(headerRow.getCells().size());
            submitCell.setBody(new HtmlSubmitButton(BundleUtil.getString(Bundle.APPLICATION, "button.selectShift")));

            return htmlTable;
        }
View Full Code Here

            final HtmlTableRow groupRow = mainTable.createRow();
            groupRow.setClasses(getCurriculumGroupRowClass());
            addTabsToRow(groupRow, level);

            final HtmlTableCell cell = groupRow.createCell();
            cell.setClasses(getLabelCellClass());

            final HtmlComponent body;
            if (curriculumGroup != null && curriculumGroup.isRoot()) {
                body =
                        createDegreeCurricularPlanNameLink(curriculumGroup.getDegreeCurricularPlanOfDegreeModule(),
                                executionPeriodContext);
            } else {
                body = new HtmlText(createGroupName(text, curriculumGroup).toString(), false);
            }
            cell.setBody(body);

            if (!addHeaders) {
                cell.setColspan(MAX_LINE_SIZE - level);// - 2);
                // generateRulesInfo(groupRow, curriculumGroup);
            } else {
                cell.setColspan(MAX_COL_SPAN_FOR_TEXT_ON_GROUPS_WITH_CHILDS - level);

                generateHeadersForGradeWeightAndEctsCredits(groupRow);
                final HtmlTableCell cellAfterEcts = groupRow.createCell();
                cellAfterEcts.setColspan(MAX_LINE_SIZE - MAX_COL_SPAN_FOR_TEXT_ON_GROUPS_WITH_CHILDS - HEADERS_SIZE);// -
                // 2);

                // generateRulesInfo(groupRow, curriculumGroup);
            }
        }
View Full Code Here

        }

        private void generateDismissalLabelCell(final HtmlTable mainTable, HtmlTableRow dismissalRow, Dismissal dismissal,
                int level) {
            // if (dismissal.hasCurricularCourse() || loggedPersonIsManager()) {
            final HtmlTableCell cell = dismissalRow.createCell();
            cell.setColspan(MAX_COL_SPAN_FOR_TEXT_ON_CURRICULUM_LINES - level);
            cell.setClasses(getLabelCellClass());
            final HtmlInlineContainer container = new HtmlInlineContainer();
            cell.setBody(container);

            if (isSelectable()) {
                final HtmlCheckBox checkBox = new HtmlCheckBox();
                checkBox.setName(getSelectionName());
                checkBox.setUserValue(dismissal.getExternalId().toString());
View Full Code Here

TOP

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

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.