Package pt.ist.fenixWebFramework.renderers.components

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


        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


            }
            return container;
        }

        private HtmlComponent getStage(CurricularStage curricularStage) {
            HtmlText text = new HtmlText(RenderUtils.getEnumString(curricularStage));

            switch (curricularStage) {
            case DRAFT:
                text.setClasses(getDraftClass());
                break;
            case PUBLISHED:
                text.setClasses(getPublishedClass());
                break;
            case APPROVED:
                text.setClasses(getApprovedClass());
                break;
            }

            return text;
        }
View Full Code Here

    }

    protected HtmlComponent getValue(PartyContact contact) {
        HtmlInlineContainer span = new HtmlInlineContainer();
        if (contact instanceof Phone) {
            span.addChild(new HtmlText(((Phone) contact).getNumber()));
        } else if (contact instanceof MobilePhone) {
            span.addChild(new HtmlText(((MobilePhone) contact).getNumber()));
        } else if (contact instanceof EmailAddress) {
            EmailAddress email = (EmailAddress) contact;
            if (isPublicSpace()) {
                HtmlImage img = new HtmlImage();
                img.setSource(RenderUtils.getContextRelativePath("") + "/publico/viewHomepage.do?method=emailPng&email="
                        + email.getExternalId());
                span.addChild(img);
            } else {
                HtmlLink link = new HtmlLink();
                link.setModuleRelative(false);
                link.setContextRelative(false);
                link.setUrl("mailto:" + email.getValue());
                link.setBody(new HtmlText(email.getValue()));
                span.addChild(link);
            }
        } else if (contact instanceof WebAddress) {
            HtmlLink link = new HtmlLink();
            link.setModuleRelative(false);
            link.setContextRelative(false);
            link.setUrl(((WebAddress) contact).getPresentationValue());
            link.setBody(new HtmlText(((WebAddress) contact).getPresentationValue()));
            span.addChild(link);
        }
        if (showType || (showDefault && contact.isDefault())) {
            StringBuilder suffix = new StringBuilder();
            suffix.append(" (");
            if (showType) {
                suffix.append(RenderUtils.getEnumString(contact.getType()));
            }
            if (showDefault && contact.isDefault()) {
                if (showType) {
                    suffix.append(", ");
                }
                suffix.append(RenderUtils.getResourceString(getBundle(), getDefaultLabel()));
            }
            suffix.append(")");
            span.addChild(new HtmlText(suffix.toString()));
        }
        return span;
    }
View Full Code Here

            studentOptionalEnrolmentBean = (StudentOptionalEnrolmentBean) object;

            HtmlBlockContainer container = new HtmlBlockContainer();

            if (studentOptionalEnrolmentBean == null) {
                return new HtmlText();
            }

            if (studentOptionalEnrolmentBean.getDegreeCurricularPlan().isBoxStructure()) {
                generateCourseGroup(container, studentOptionalEnrolmentBean.getDegreeCurricularPlan().getRoot(), 0);
            } else {
View Full Code Here

            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

                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());
View Full Code Here

            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

            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());
View Full Code Here

                            link.setOnClick(RenderUtils.getFormattedProperties(getOnClick(), tag));
                        }
                        if (getOnDblClick() != null) {
                            link.setOnDblClick(RenderUtils.getFormattedProperties(getOnDblClick(), tag));
                        }
                        HtmlText text = new HtmlText(tag.getName());
                        text.setClasses(getHtmlClass(maximum, tag, person));
                        link.setBody(text);
                        HtmlListItem item = container.createItem();

                        addExtraParameters(link, tag);
View Full Code Here

            @Override
            public HtmlComponent createComponent(Object object, Class type) {
                Grade grade = (Grade) object;
                if (grade == null || grade.isEmpty()) {
                    return new HtmlText();
                }

                HtmlInlineContainer container = new HtmlInlineContainer();
                HtmlText gradeValue = new HtmlText(grade.getValue());
                gradeValue.setClasses(getGradeClasses());
                container.addChild(gradeValue);
                if (isShowGradeScale()) {
                    HtmlText gradeScale = new HtmlText("(" + RenderUtils.getEnumString(grade.getGradeScale()) + ")");
                    gradeScale.setClasses(getGradeScaleClasses());
                    container.addChild(gradeScale);
                }

                return container;
            }
View Full Code Here

TOP

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

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.