Package pt.ist.fenixWebFramework.renderers.components

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


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


            public HtmlComponent createComponent(Object object, Class type) {
                Collection<UnitFileTag> tags =
                        (getSortBy() != null) ? RenderUtils.sortCollectionWithCriteria((Collection<UnitFileTag>) object,
                                getSortBy()) : new ArrayList<UnitFileTag>((Collection<UnitFileTag>) object);

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

        return new Layout() {

            @Override
            public HtmlComponent createComponent(Object object, Class type) {
                Grade grade = (Grade) object;
                HtmlInlineContainer container = new HtmlInlineContainer();

                MetaSlot slot = (MetaSlot) getInputContext().getMetaObject();

                final HtmlGradeTextInput value = new HtmlGradeTextInput(isRequired());
                value.bind(slot);

                value.setMaxLength(getMaxLength());
                value.setSize(getSize());

                HtmlMenu menu = new HtmlMenu();
                menu.setName(slot.getKey().toString() + "_scale");

                menu.createDefaultOption(RenderUtils.getResourceString("renderers.menu.default.title"));
                for (GradeScale scale : GradeScale.values()) {
                    menu.createOption(RenderUtils.getEnumString(scale)).setValue(scale.getName());
                }

                if (grade != null && !grade.isEmpty()) {
                    value.setValue(grade.getValue());
                    menu.setValue(grade.getGradeScale().getName());
                }

                menu.setController(new HtmlController() {

                    @Override
                    public void execute(IViewState viewState) {
                        HtmlSimpleValueComponent component = (HtmlSimpleValueComponent) getControlledComponent();
                        value.setConverter(new GradeConverter(component.getValue()));
                    }

                });

                container.addChild(value);
                container.addChild(menu);

                return container;
            }

        };
View Full Code Here

            public HtmlComponent createComponent(Object unfiltered, Class type) {
                List<MetaObject> contacts = getFilteredContacts((Collection<PartyContact>) unfiltered);
                if (contacts.isEmpty()) {
                    return new HtmlText();
                }
                HtmlInlineContainer span = new HtmlInlineContainer();
                int rowIndex = 0;
                for (MetaObject meta : contacts) {
                    HtmlTableRow row = new HtmlTableRow();
                    row.setClasses(getRowClasses());
                    if (rowIndex == 0) {
                        HtmlTableCell left = row.createCell(CellType.HEADER);
                        left.setClasses(getLeftColumnClasses());
                        left.setStyle(getLeftLineStyle());
                        left.setRowspan(contacts.size());
                        left.setBody(new HtmlText(RenderUtils.getResourceString(getBundle(), getLabel()) + ":"));
                    }
                    HtmlTableCell right = row.createCell();
                    right.setClasses(getRightColumnClasses());
                    right.setStyle(getRightLineStyle());
                    right.setBody(getValue((PartyContact) meta.getObject()));
                    span.addChild(row);
                    rowIndex++;
                }
                return span;
            }
        };
View Full Code Here

            return container;
        }

        protected HtmlComponent getLinks(CompetenceCourse course) {
            HtmlInlineContainer container = new HtmlInlineContainer();
            int total = sortedLinks.size();
            for (int i = 0; i < total; i++) {
                TableLink tableLink = getTableLink(i);
                container.addChild(tableLink.generateLink(course));
                if (i + 1 < total) {
                    container.addChild(new HtmlText(getLinkGroupSeparator()));
                }
            }
            container.setIndented(false);
            return container;

        }
View Full Code Here

        }

        private HtmlComponent getCurrentOrFutureCoursePresentation(CompetenceCourse course, CompetenceCourseGroupUnit group,
                DepartmentUnit department) {
            HtmlInlineContainer container = new HtmlInlineContainer();
            container.addChild(new HtmlText(course.getName()));
            container.addChild(new HtmlText(" ("));
            container.addChild(new HtmlText(course.getAcronym()));
            container.addChild(new HtmlText(") "));
            container.addChild(getStage(course.getCurricularStage()));
            if (course.getCompetenceCourseGroupUnit() != group) {
                container.addChild(new HtmlText(" ("));
                container.addChild(getFutureTransferMessage(course));
                container.addChild(new HtmlText(") "));
            } else if (course.getDepartmentUnit(ExecutionSemester.readLastExecutionSemester()) != department) {
                container.addChild(new HtmlText(" ("));
                container.addChild(getFutureDepartmentMessage(course));
                container.addChild(new HtmlText(") "));
            } else if (course.getCompetenceCourseGroupUnit(ExecutionSemester.readLastExecutionSemester()) != group) {
                container.addChild(new HtmlText(" ("));
                container.addChild(getFutureGroupMessage(course));
                container.addChild(new HtmlText(") "));
            }
            container.setIndented(false);
            return container;
        }
View Full Code Here

            text.setClasses(getMessageClass());
            return text;
        }

        private HtmlComponent getOldCoursePresentation(CompetenceCourse course) {
            HtmlInlineContainer container = new HtmlInlineContainer();
            container.addChild(new HtmlText(course.getName()));
            container.addChild(new HtmlText(" ("));
            container.addChild(new HtmlText(course.getAcronym()));
            container.addChild(new HtmlText(") "));
            container.addChild(getStage(course.getCurricularStage()));
            container.addChild(new HtmlText(" ("));
            container.addChild(getOldDepartmentMessage(course));
            container.addChild(new HtmlText(")"));
            container.setIndented(false);
            return container;
        }
View Full Code Here

                caption.setFace(Face.STRONG);
                container.addChild(caption);
                HtmlList list = new HtmlList();
                if (isOldDepartmentMessageShown()) {
                    HtmlListItem item = list.createItem();
                    HtmlInlineContainer messageLine = new HtmlInlineContainer();
                    HtmlText message = new HtmlText(BundleUtil.getString(Bundle.BOLONHA, "current.department") + ":");
                    message.setFace(Face.EMPHASIS);
                    messageLine.addChild(message);
                    messageLine.addChild(new HtmlText(BundleUtil.getString(Bundle.BOLONHA, "current.department.caption")));
                    item.addChild(messageLine);
                }
                if (isFutureDepartmentMessageShown()) {
                    HtmlListItem item = list.createItem();
                    HtmlInlineContainer messageLine = new HtmlInlineContainer();
                    HtmlText message = new HtmlText(BundleUtil.getString(Bundle.BOLONHA, "future.department") + ":");
                    message.setFace(Face.EMPHASIS);
                    messageLine.addChild(message);
                    messageLine.addChild(new HtmlText(BundleUtil.getString(Bundle.BOLONHA, "future.department.caption")));
                    item.addChild(messageLine);
                }
                if (isFutureGroupMessageShown()) {
                    HtmlListItem item = list.createItem();
                    HtmlInlineContainer messageLine = new HtmlInlineContainer();
                    HtmlText message = new HtmlText(BundleUtil.getString(Bundle.BOLONHA, "future.group") + ":");
                    message.setFace(Face.EMPHASIS);
                    messageLine.addChild(message);
                    messageLine.addChild(new HtmlText(BundleUtil.getString(Bundle.BOLONHA, "future.group.caption")));
                    item.addChild(messageLine);
                }
                if (isFutureTransferMessageShown()) {
                    HtmlListItem item = list.createItem();
                    HtmlInlineContainer messageLine = new HtmlInlineContainer();
                    HtmlText message = new HtmlText(BundleUtil.getString(Bundle.BOLONHA, "future.transfer") + ":");
                    message.setFace(Face.EMPHASIS);
                    messageLine.addChild(message);
                    messageLine.addChild(new HtmlText(BundleUtil.getString(Bundle.BOLONHA, "future.transfer.caption")));
                    item.addChild(messageLine);
                }
                container.addChild(list);
            }
            return container;
View Full Code Here

TOP

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

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.