Package pt.ist.fenixWebFramework.renderers.components

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


        private void generateAverageSums(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(15);

            final HtmlTableCell sumPiCell = row.createCell();
            sumPiCell.setText(this.curriculum.getSumPi().toString());
            sumPiCell.setClasses(getGradeCellClass());

            final HtmlTableCell sumPiCiCell = row.createCell();
            sumPiCiCell.setText(this.curriculum.getSumPiCi().toString());
            sumPiCiCell.setClasses(getGradeCellClass());

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


        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 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

        generateCellWithSpan(row, text, title, cssClass, 1);
    }

    private void generateCellWithSpan(final HtmlTableRow row, final String text, final String title, final String cssClass,
            final Integer colSpan) {
        final HtmlTableCell cell = row.createCell();
        cell.setClasses(cssClass);
        cell.setColspan(colSpan);

        final HtmlInlineContainer span = new HtmlInlineContainer();
        span.addChild(new HtmlText(text));
        span.setTitle(title);

        cell.setBody(span);
    }
View Full Code Here

                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());
                    actionLink.setOnClick(String.format(
                            "$(this).closest('form').find('input[name=\\'method\\']').attr('value', '%s');", getMethodName()));
                    //actionLink.setOnClick(String.format("document.forms[0].method.value='%s';", getMethodName()));
                    actionLink.setController(new UpdateSelectedCurricularCourseController(curricularCourse));
                    linkTableCell.setBody(actionLink);
                }
            }
        }
View Full Code Here

            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());
                actionLink.setOnClick(String.format(
                        "$(this).closest('form').find('input[name=\\'method\\']').attr('value', '%s');", getMethodName()));
                //actionLink.setOnClick(String.format("document.forms[0].method.value='%s';", getMethodName()));
                actionLink.setController(new UpdateSelectedCurricularCourseController(scope.getCurricularCourse()));
                linkTableCell.setBody(actionLink);
            }
        }
View Full Code Here

        }

        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

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

            final HtmlTableCell radioButtonCell = htmlTableRow.createCell();
            final HtmlRadioButton radioButton = radioButtonGroup.createRadioButton();
            radioButton.setUserValue(MetaObjectFactory.createObject(curriculumGroup, new Schema(CurriculumGroup.class)).getKey()
                    .toString());
            radioButton.setChecked(curriculumGroup == dismissalBean.getCurriculumGroup());
            radioButtonCell.setBody(radioButton);
            radioButtonCell.setClasses(getGroupRadioClasses());
            radioButtonCell.setStyle("width: 2em;");

        }
View Full Code Here

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

                final HtmlTableCell nameCell = htmlTableRow.createCell();

                final String code = curricularCourse.getCode();
                final String oneFullName = curricularCourse.getOneFullName(executionSemester);
                final String name =
                        " <span class='bold'>" + curricularCourse.getName(dismissalBean.getExecutionPeriod()) + "</span> ("
                                + oneFullName.substring(0, oneFullName.lastIndexOf(">")) + ")";
                final String codeAndname = StringUtils.isEmpty(code) ? name : code + " - " + name;
                nameCell.setBody(new HtmlText(codeAndname, false));

                nameCell.setClasses(getCurricularCourseNameClasses());

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

                final HtmlCheckBox checkBox =
                        new HtmlCheckBox(dismissalBean.containsDismissalOrOptionalDismissal(curricularCourse));
                checkBox.setName("curricularCourseCheckBox" + curricularCourse.getExternalId());
                if (curricularCourse.isOptionalCurricularCourse()) {
                    final OptionalCurricularCourse optionalCurricularCourse = (OptionalCurricularCourse) curricularCourse;
                    checkBox.setUserValue(new DismissalBean.SelectedOptionalCurricularCourse(optionalCurricularCourse,
                            studentCurricularPlan).getKey());
                    checkBoxCell.setBody(checkBox);
                    optionalCurricularCoursesController.addCheckBox(checkBox);
                } else {
                    checkBox.setUserValue(new DismissalBean.SelectedCurricularCourse(curricularCourse, studentCurricularPlan)
                            .getKey());
                    checkBoxCell.setBody(checkBox);
                    curricularCoursesController.addCheckBox(checkBox);
                }
            }
        }
View Full Code Here

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

            final HtmlTableCell currentCreditsCell = htmlTableRow.createCell();
            final double ectsCreditsForCourseGroup =
                    studentCurricularPlan.getCreditsConcludedForCourseGroup(courseGroup).doubleValue();
            if (ectsCreditsForCourseGroup == 0d) {
                currentCreditsCell.setBody(new HtmlText("ECTS:  -"));
            } else {
                currentCreditsCell.setBody(new HtmlText("ECTS: " + ectsCreditsForCourseGroup));
            }
            currentCreditsCell.setClasses("smalltxt");
            currentCreditsCell.setStyle("width: 6em;");

            final HtmlTableCell creditsMinCell = htmlTableRow.createCell();
            creditsMinCell.setBody(new HtmlText("Min: " + courseGroup.getMinEctsCredits(executionSemester)));
            creditsMinCell.setClasses("smalltxt");
            creditsMinCell.setStyle("width: 6em;");

            final HtmlTableCell creditsMaxCell = htmlTableRow.createCell();
            creditsMaxCell.setBody(new HtmlText("Max: " + courseGroup.getMaxEctsCredits(executionSemester)));
            creditsMaxCell.setClasses("smalltxt");
            creditsMaxCell.setStyle("width: 6em;");

            final HtmlTableCell radioButtonCell = htmlTableRow.createCell();
            final HtmlRadioButton radioButton = radioButtonGroup.createRadioButton();
            radioButton.setUserValue(MetaObjectFactory.createObject(courseGroup, new Schema(CourseGroup.class)).getKey()
                    .toString());
            radioButton.setChecked(courseGroup == dismissalBean.getCourseGroup());
            radioButtonCell.setBody(radioButton);
            radioButtonCell.setClasses(getGroupRadioClasses());
            radioButtonCell.setStyle("width: 2em;");

            for (final Context context : courseGroup.getSortedOpenChildContextsWithCourseGroups(executionSemester)) {
                generateCourseGroups(blockContainer, studentCurricularPlan, (CourseGroup) context.getChildDegreeModule(),
                        executionSemester, depth + getWidthDecreasePerLevel());
            }
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.