Examples of HtmlInlineContainer


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

    @Override
    protected Layout getLayout(Object object, Class type) {
        return new Layout() {

            private HtmlComponent processUnionGroup(UnionGroup object) {
                HtmlContainer container = new HtmlInlineContainer();
                container.setIndented(false);

                int i = object.getChildren().size();

                for (Group child : object.getChildren()) {
                    if (child instanceof UnionGroup) {
                        container.addChild(processUnionGroup((UnionGroup) child));
                    } else {
                        container.addChild(new HtmlText(child.getPresentationName()));
                    }
                    i--;
                    if (i > 0) {
                        container.addChild(new HtmlText(", "));
                    }
                }

                return container;
            }

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

                HtmlInlineContainer container = new HtmlInlineContainer();

                if (object instanceof UnionGroup) {
                    container.addChild(processUnionGroup((UnionGroup) object));
                } else {
                    Group group = (Group) object;
                    container.addChild(new HtmlText(group.getPresentationName()));
                }

                return container;
            }
View Full Code Here

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

                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());
                container.addChild(checkBox);
            }

            final HtmlText text =
                    new HtmlText(BundleUtil.getString(Bundle.STUDENT, "label.dismissal."
                            + dismissal.getCredits().getClass().getSimpleName()));
            container.addChild(text);

            final CurricularCourse curricularCourse = dismissal.getCurricularCourse();
            if (curricularCourse != null) {

                String codeAndName = "";
                if (!StringUtils.isEmpty(curricularCourse.getCode())) {
                    codeAndName += curricularCourse.getCode() + " - ";
                }
                codeAndName += dismissal.getName().getContent();
                final HtmlLink curricularCourseLink = createCurricularCourseLink(codeAndName, curricularCourse);
                container.addChild(new HtmlText(": "));
                container.addChild(curricularCourseLink);
            }

            // } else {
            // generateCellWithText(dismissalRow,
            // BundleUtil.getString(Bundle.STUDENT, "label.dismissal." +
View Full Code Here

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

        private void generateStatisticsLinkCell(final HtmlTableRow row, final Enrolment enrolment) {
            if (enrolment.getStudent() == AccessControl.getPerson().getStudent()
                    && enrolment.getStudent().hasAnyActiveRegistration()) {
                ExecutionCourse executionCourse = enrolment.getExecutionCourseFor(enrolment.getExecutionPeriod());
                if (executionCourse != null) {
                    final HtmlInlineContainer inlineContainer = new HtmlInlineContainer();
                    inlineContainer.addChild(createExecutionCourseStatisticsLink(
                            BundleUtil.getString(Bundle.APPLICATION, "label.statistics"), executionCourse));
                    final HtmlTableCell cell = row.createCell();
                    cell.setClasses(getStatisticsLinkCellClass());
                    cell.setBody(inlineContainer);
                }
View Full Code Here

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

        }

        private void generateCurricularCourseCodeAndNameCell(final HtmlTableRow enrolmentRow, final Enrolment enrolment,
                final int level, boolean allowSelection) {

            final HtmlInlineContainer inlineContainer = new HtmlInlineContainer();

            if (isSelectable() && allowSelection) {
                final HtmlCheckBox checkBox = new HtmlCheckBox();
                checkBox.setName(getSelectionName());
                checkBox.setUserValue(enrolment.getExternalId().toString());
                inlineContainer.addChild(checkBox);
            }

            inlineContainer.addChild(createCurricularCourseLink(getPresentationNameFor(enrolment),
                    enrolment.getCurricularCourse()));

            final HtmlTableCell cell = enrolmentRow.createCell();
            cell.setClasses(getLabelCellClass());
            cell.setColspan(MAX_COL_SPAN_FOR_TEXT_ON_CURRICULUM_LINES - level);
View Full Code Here

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

            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

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

        }

        private void generateCodeAndNameCell(final HtmlTableRow enrolmentRow, final ICurriculumEntry entry, final int level,
                boolean allowSelection) {

            final HtmlInlineContainer inlineContainer = new HtmlInlineContainer();
            inlineContainer.addChild(new HtmlText(getPresentationNameFor(entry)));

            final HtmlTableCell cell = enrolmentRow.createCell();
            cell.setClasses(getLabelCellClass());
            cell.setColspan(MAX_COL_SPAN_FOR_TEXT_ON_CURRICULUM_LINES - (entry instanceof ExternalEnrolment ? 1 : 0) - level);
            cell.setBody(inlineContainer);
View Full Code Here

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

                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

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

        }
        return false;
    }

    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

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

                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

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

    private HtmlComponent addLabel(Person person, HtmlComponent component, String label) {
        if (label == null) {
            return component;
        } else {
            HtmlInlineContainer container = new HtmlInlineContainer();

            container.addChild(component);
            container.addChild(getStyledLabel(label));

            return container;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.