Package org.richfaces.component

Examples of org.richfaces.component.AbstractCarousel


    @Override
    protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
        if (!(component instanceof AbstractCarousel)) {
            return;
        }
        AbstractCarousel carousel = (AbstractCarousel) component;
        writer.startElement(HtmlConstants.DIV_ELEM, null);
        writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, getUtils().clientId(context, component), "type");
        String styleClass = "rf-crl" + (carousel.getFlavor() != null ? " " + carousel.getFlavor().name() : "");
        styleClass += carousel.getStyleClass() != null ? " " + carousel.getStyleClass() : "";
        writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, styleClass, "class");
        getUtils().encodeAttributesFromArray(context, component, new String[]{"style"});
    }
View Full Code Here


        getUtils().encodeAttributesFromArray(context, component, new String[]{"style"});
    }

    @Override
    protected void doEncodeChildren(final ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
        final AbstractCarousel repeater = (AbstractCarousel) component;
        if (repeater.getValue() != null) {
            try {
                DataVisitor visitor = new DataVisitor() {
                    public DataVisitResult process(FacesContext context, Object rowKey, Object argument) {
                        repeater.setRowKey(context, rowKey);

                        if (repeater.isRowAvailable()) {
                            if (repeater.getChildCount() > 0) {
                                try {
                                    writer.startElement(HtmlConstants.DIV_ELEM, null);
                                    writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-crl-sl", "class");
                                    for (UIComponent child : repeater.getChildren()) {
                                        child.encodeAll(context);
                                    }
                                    writer.endElement(HtmlConstants.DIV_ELEM);
                                } catch (IOException e) {
                                    e.printStackTrace();
                                }
                            }
                        }

                        return DataVisitResult.CONTINUE;
                    }
                };

                repeater.walk(context, visitor, null);
            } finally {
                repeater.setRowKey(context, null);
            }
        } else {
            for (UIComponent child : component.getChildren()) {
                writer.startElement(HtmlConstants.DIV_ELEM, null);
                writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-crl-sl", "class");
View Full Code Here

TOP

Related Classes of org.richfaces.component.AbstractCarousel

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.