Package pt.ist.fenixWebFramework.renderers.components

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


            return container;
        }
    }

    private HtmlText getStyledLabel(String label) {
        HtmlText text = new HtmlText("(" + label + ")");

        text.setClasses(getLabelClass());
        text.setStyle(getLabelStyle());

        return text;
    }
View Full Code Here


            @Override
            public HtmlComponent createComponent(Object object, Class type) {

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

                Lesson lesson = (Lesson) object;
                return new HtmlText(lesson.prettyPrint());
            }
        };
    }
View Full Code Here

        return new Layout() {
            @Override
            public HtmlComponent createComponent(Object object, Class type) {

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

                String email = null;
                String name = null;
                try {
                    email = BeanUtils.getProperty(object, getAddress());
                    name = BeanUtils.getProperty(object, getText());
                } catch (Exception e) {

                    throw new RuntimeException(e);
                }

                HtmlText nameHtml = new HtmlText(name);

                HtmlLink emailHtml = new HtmlLink();
                emailHtml.setContextRelative(false);
                emailHtml.setUrl("mailto:" + email);

                if (!isCollapsed()) {
                    emailHtml.setText(email);
                    HtmlInlineContainer container = new HtmlInlineContainer();
                    container.addChild(nameHtml);
                    container.addChild(new HtmlText(" <", true));
                    container.addChild(emailHtml);
                    container.addChild(new HtmlText(">", true));
                    container.setIndented(false);

                    return container;
                } else {
                    emailHtml.setText(name);
View Full Code Here

                HtmlInlineContainer container = new HtmlInlineContainer();
                int i = 0;
                for (UnitFileTag tag : tags) {
                    if (tag.isTagAccessibleToUser(AccessControl.getPerson())) {
                        if (i > 0) {
                            container.addChild(new HtmlText(" " + getSeparator() + " "));
                        }

                        HtmlComponent component = null;
                        if (getLinkFormat() != null) {
                            HtmlLink link = new HtmlLink();
                            link.setModuleRelative(isModuleRelative());
                            link.setContextRelative(isContextRelative());
                            link.setUrl(RenderUtils.getFormattedProperties(getLinkFormat(), tag));
                            link.setBody(getText(tag));
                            component = link;
                        } else {
                            component = getText(tag);
                        }
                        container.addChild(component);
                        i++;
                    }
                }
                if (getShowAllUrl() != null) {
                    HtmlLink link = new HtmlLink();
                    link.setModuleRelative(isModuleRelative());
                    link.setContextRelative(isContextRelative());
                    link.setUrl(getShowAllUrl());
                    link.setBody(new HtmlText(RenderUtils.getResourceString("RENDERER_RESOURCES", "renderers.show.all")));
                    container.addChild(new HtmlText(" " + getSeparator() + " "));
                    container.addChild(link);
                }
                return container;
            }

            private HtmlComponent getText(UnitFileTag tag) {
                return new HtmlText(tag.getName() + "(" + tag.getFileTagCount(AccessControl.getPerson()) + ") ");
            }

        };
    }
View Full Code Here

                if (visible) {
                    return layout.createComponent(object, type);
                } else {
                    String text = getText();
                    return (text != null) ? new HtmlText(text) : renderValue(object,
                            RenderKit.getInstance().findSchema(getSubSchema()), getSubLayout());
                }
            }

        };
View Full Code Here

            studentEnrolmentBean = (StudentEnrolmentBean) object;

            HtmlBlockContainer container = new HtmlBlockContainer();

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

            HtmlMultipleHiddenField hiddenEnrollments = new HtmlMultipleHiddenField();
            hiddenEnrollments.bind(getInputContext().getMetaObject(), "curriculumModules"); // slot
            // refered
View Full Code Here

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

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

            HtmlCheckBox checkBox = new HtmlCheckBox(false);
            checkBox.setName("degreeModuleToEnrolCheckBox" + degreeModuleToEnrol.getContext().getExternalId() + ":"
View Full Code Here

                CurricularCourse curricularCourse = (CurricularCourse) degreeModuleToEnrol.getContext().getChildDegreeModule();

                HtmlTableRow htmlTableRow = groupTable.createRow();
                HtmlTableCell cellName = htmlTableRow.createCell();
                cellName.setClasses(getCurricularCourseNameClasses());
                cellName.setBody(new HtmlText(curricularCourse.getName()));

                // Year
                final HtmlTableCell yearCell = htmlTableRow.createCell();
                yearCell.setClasses(getCurricularCourseYearClasses());
                yearCell.setColspan(2);

                final StringBuilder year = new StringBuilder();
                year.append(degreeModuleToEnrol.getContext().getCurricularPeriod().getFullLabel());
                yearCell.setBody(new HtmlText(year.toString()));

                if (!curricularCourse.isOptionalCurricularCourse()) {
                    // Ects
                    final HtmlTableCell ectsCell = htmlTableRow.createCell();
                    ectsCell.setClasses(getCurricularCourseEctsClasses());

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

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

                    HtmlCheckBox checkBox = new HtmlCheckBox(false);
                    checkBox.setName("degreeModuleToEnrolCheckBox" + degreeModuleToEnrol.getContext().getExternalId() + ":"
                            + degreeModuleToEnrol.getCurriculumGroup().getExternalId());
                    checkBox.setUserValue(degreeModuleToEnrol.getKey());
                    degreeModulesToEnrolController.addCheckBox(checkBox);
                    checkBoxCell.setBody(checkBox);
                } else {
                    final HtmlTableCell cell = htmlTableRow.createCell();
                    cell.setClasses(getCurricularCourseEctsClasses());
                    cell.setBody(new HtmlText(""));

                    HtmlTableCell linkTableCell = htmlTableRow.createCell();
                    linkTableCell.setClasses(getCurricularCourseCheckBoxClasses());

                    final HtmlLink htmlLink = new HtmlLink();
View Full Code Here

        private void generateEnrolment(final HtmlTable groupTable, Enrolment enrolment) {
            HtmlTableRow htmlTableRow = groupTable.createRow();
            HtmlTableCell cellName = htmlTableRow.createCell();
            cellName.setClasses(getEnrolmentNameClasses());
            cellName.setBody(new HtmlText(enrolment.getName().getContent()));

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

            final StringBuilder year = new StringBuilder();
            year.append(enrolment.getExecutionPeriod().getExecutionYear().getYear());
            yearCell.setBody(new HtmlText(year.toString()));

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

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

            final StringBuilder ects = new StringBuilder();
            ects.append(enrolment.getCurricularCourse().getEctsCredits()).append(" ")
                    .append(BundleUtil.getString(Bundle.ACADEMIC, "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());
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.