Package pt.ist.fenixWebFramework.renderers.components

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


        HtmlTable groupTable = createGroupTable(container, 0);

        HtmlTableRow htmlTableRow = groupTable.createRow();
        htmlTableRow.setClasses(getRenderer().getGroupRowClasses());
        htmlTableRow.createCell().setBody(new HtmlText("Other Curricular Units", false));
        HtmlTableCell cell = htmlTableRow.createCell();
        cell.setClasses("aright");

        HtmlCheckBox checkBox = new HtmlCheckBox(false);
        final String name = "degreeModuleToEnrolCheckBox";
        checkBox.setName(name);
        checkBox.setUserValue("true");
        checkBox.setChecked(true);

        cell.setBody(checkBox);
        groupTable = createCoursesTable(container, 0);
        NoCourseGroupCurriculumGroup group =
                getBolonhaStudentEnrollmentBean().getStudentCurricularPlan().getNoCourseGroupCurriculumGroup(
                        NoCourseGroupCurriculumGroupType.STANDALONE);
        HashSet<CurricularCourse> set = new HashSet<CurricularCourse>();
        ErasmusBolonhaStudentEnrollmentBean erasmusBolonhaStudentEnrollmentBean =
                (ErasmusBolonhaStudentEnrollmentBean) getBolonhaStudentEnrollmentBean();
        set.addAll(erasmusBolonhaStudentEnrollmentBean.getCandidacy().getCurricularCoursesSet());
        for (Enrolment enrolment : group.getEnrolments()) {
            set.add(enrolment.getCurricularCourse());
        }

        for (CurricularCourse curricularCourse : set) {
            if (erasmusBolonhaStudentEnrollmentBean.getStudentCurricularPlan().getEnrolmentByCurricularCourseAndExecutionPeriod(
                    curricularCourse, erasmusBolonhaStudentEnrollmentBean.getExecutionPeriod()) != null) {
                if (!group.hasEnrolmentWithEnroledState(curricularCourse,
                        erasmusBolonhaStudentEnrollmentBean.getExecutionPeriod())) {

                    continue;
                }
            }

            if (!isContextValid(curricularCourse)) {
                continue;
            }

            htmlTableRow = groupTable.createRow();
            HtmlTableCell cellName = htmlTableRow.createCell();
            cellName.setClasses(getRenderer().getCurricularCourseToEnrolNameClasses());

            String degreeName = curricularCourse.getName();

            if (isAcademicRelationsOfficeMember() && curricularCourse instanceof CurricularCourse) {
                if (!StringUtils.isEmpty(curricularCourse.getCode())) {
                    degreeName = curricularCourse.getCode() + " - " + degreeName;
                }

                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(getBolonhaStudentEnrollmentBean().getExecutionPeriod().getQualifiedName()));

            final HtmlTableCell ectsCell = htmlTableRow.createCell();
            ectsCell.setClasses(getRenderer().getCurricularCourseToEnrolEctsClasses());

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

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

            checkBox = new HtmlCheckBox(false);
            checkBox.setName("extraCurricularEnrolments" + curricularCourse.getClass().getCanonicalName() + ":"
                    + curricularCourse.getExternalId());
            checkBox.setUserValue(curricularCourse.getClass().getCanonicalName() + ":" + curricularCourse.getExternalId());
            checkBoxCell.setBody(checkBox);
            controller.addCheckBox(checkBox);

            if (group.hasEnrolmentWithEnroledState(curricularCourse, erasmusBolonhaStudentEnrollmentBean.getExecutionPeriod())) {
                cellName.setClasses(getRenderer().getEnrolmentNameClasses());
                yearCell.setClasses(getRenderer().getEnrolmentYearClasses());
                ectsCell.setClasses(getRenderer().getEnrolmentEctsClasses());
                checkBoxCell.setClasses(getRenderer().getEnrolmentCheckBoxClasses());

                checkBox.setChecked(true);
            }

        }
View Full Code Here


        }

        String buttonText = getButtonText();
        int i = 0;
        for (HtmlTableRow row : table.getRows()) {
            HtmlTableCell cell = row.createCell();
            HtmlSubmitButton htmlSubmitButton = new HtmlSubmitButton();
            htmlSubmitButton.setName(getLocalName("select" + i));
            htmlSubmitButton.setText(buttonText);
            htmlSubmitButton.setController(new ButtonsController(MetaObjectFactory.createObject(objects.get(i), null), selected));
            cell.setBody(htmlSubmitButton);
            i++;
        }

        addPreviousNextButtons(container, page, "previousAfter", "nextAfter");
View Full Code Here

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

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

                // Year
                final HtmlTableCell yearCell = htmlTableRow.createCell();
                yearCell.setClasses(getCurricularCourseYearClasses());
                yearCell.setBody(new HtmlText(RenderUtils.getResourceString("STUDENT_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()).append(" ")
                        .append(BundleUtil.getString(Bundle.STUDENT, "label.credits.abbreviation"));
                ectsCell.setBody(new HtmlText(ects.toString()));

                // Enrollment Link
                final HtmlTableCell linkTableCell = htmlTableRow.createCell();
                linkTableCell.setClasses(getCurricularCourseLinkClasses());

                final HtmlActionLink actionLink = new HtmlActionLink();
                actionLink.setText(BundleUtil.getString(Bundle.STUDENT, "label.enroll"));
                actionLink.setName("optionalCurricularCourseEnrolLink" + scope.getCurricularCourse().getExternalId());
                actionLink
                        .setOnClick("$(this).closest('form').find('input[name=\\'method\\']').attr('value', 'enrolInOptionalCurricularCourse');");
                //actionLink.setOnClick("document.forms[2].method.value='enrolInOptionalCurricularCourse';");
                actionLink.setController(new UpdateSelectedOptionalCurricularCourseController(scope.getCurricularCourse()));
                linkTableCell.setBody(actionLink);
            }
        }
View Full Code Here

            for (final 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(getCurricularCoursePresentationName(curricularCourse)));

                    // 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()).append(" ")
                            .append(BundleUtil.getString(Bundle.STUDENT, "label.credits.abbreviation"));
                    ectsCell.setBody(new HtmlText(ects.toString()));

                    // Enrollment Link
                    final HtmlTableCell linkTableCell = htmlTableRow.createCell();
                    linkTableCell.setClasses(getCurricularCourseLinkClasses());

                    final HtmlActionLink actionLink = new HtmlActionLink();
                    actionLink.setText(BundleUtil.getString(Bundle.STUDENT, "label.enroll"));
                    actionLink.setName("optionalCurricularCourseEnrolLink" + curricularCourse.getExternalId() + "_"
                            + context.getExternalId());
                    actionLink
                            .setOnClick("$(this).closest('form').find('input[name=\\'method\\']').attr('value', 'enrolInOptionalCurricularCourse');");
                    //actionLink.setOnClick("document.forms[2].method.value='enrolInOptionalCurricularCourse';");
                    actionLink.setController(new UpdateSelectedOptionalCurricularCourseController(curricularCourse));
                    linkTableCell.setBody(actionLink);
                }
            }
        }
View Full Code Here

    private void drawCourseGroupName(final CourseGroup courseGroup, final HtmlTable mainTable, final int level) {
        final HtmlTableRow groupRow = mainTable.createRow();
        groupRow.setClasses(getCourseGroupRowClass());
        addTabsToRow(groupRow, level);

        final HtmlTableCell cell = groupRow.createCell();
        cell.setClasses(getLabelCellClass());
        cell.setBody(new HtmlText(courseGroup.getNameI18N().getContent()));

        if (showCourses() && courseGroup.hasAnyChildContextWithCurricularCourse()) {
            cell.setColspan(getMaxColSpanForTextOnGroupsWithChilds() - level);
            drawCurricularPeriodHeader(groupRow);
            drawCourseLoadHeader(groupRow);
            drawEctsCreditsHeader(groupRow);
        } else {
            cell.setColspan(getMaxLineSize() - level);
        }
    }
View Full Code Here

            cell.setColspan(getMaxLineSize() - level);
        }
    }

    private void drawCurricularPeriodHeader(final HtmlTableRow row) {
        final HtmlTableCell cell = row.createCell();
        cell.setClasses(getCourseLoadCellClass());
        cell.setColspan(2);
        cell.setText(getLabel("label.degreeCurricularPlan.renderer.curricular.period"));
    }
View Full Code Here

        cell.setColspan(2);
        cell.setText(getLabel("label.degreeCurricularPlan.renderer.curricular.period"));
    }

    private void drawCourseLoadHeader(final HtmlTableRow row) {
        final HtmlTableCell cell = row.createCell();
        cell.setClasses(getCourseLoadCellClass());
        cell.setText(getLabel("label.degreeCurricularPlan.renderer.course.load"));
    }
View Full Code Here

        cell.setClasses(getCourseLoadCellClass());
        cell.setText(getLabel("label.degreeCurricularPlan.renderer.course.load"));
    }

    private void drawEctsCreditsHeader(final HtmlTableRow row) {
        final HtmlTableCell cell = row.createCell();
        cell.setClasses(getEctsCreditsCellClass());
        cell.setText(getLabel("label.degreeCurricularPlan.renderer.ects"));
    }
View Full Code Here

            drawEctsCredits(curricularCourse, context.getCurricularPeriod(), row);
        }
    }

    private void drawContextInformation(final CurricularPeriod period, final HtmlTableRow row) {
        final HtmlTableCell cell = row.createCell();
        cell.setClasses(getCurricularPeriodCellClass());
        cell.setText(CurricularPeriodLabelFormatter.getFullLabel(period, true));
    }
View Full Code Here

    }

    private void drawCourseLoad(final CurricularCourse course, final CurricularPeriod period, final ExecutionSemester interval,
            final HtmlTableRow row) {

        final HtmlTableCell cell = row.createCell();
        cell.setClasses(getCourseLoadCellClass());

        if (course.isOptionalCurricularCourse()) {
            cell.setText(EMPTY_CELL);
        } else {
            final StringBuilder builder = new StringBuilder();

            builder.append(getLabel("label.degreeCurricularPlan.renderer.acronym.contact.load")).append("-");
            builder.append(roundValue(course.getContactLoad(period, interval))).append(" ");

            builder.append(getLabel("label.degreeCurricularPlan.renderer.acronym.autonomous.work")).append("-");
            builder.append(course.getAutonomousWorkHours(period, interval).toString()).append(" ");

            builder.append(getLabel("label.degreeCurricularPlan.renderer.acronym.total.load")).append("-");
            builder.append(course.getTotalLoad(period, interval));

            cell.setText(builder.toString());
        }

        cell.setTitle(getLabel("label.degreeCurricularPlan.renderer.title.course.load"));
    }
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.