Examples of UIPanelBox


Examples of org.dekka.component.objectInterface.UIPanelBox

    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        if (!RenderKitUtils.assertValid(context, component)) {
            return;
        }
        final ResponseWriter writer = context.getResponseWriter();
        final UIPanelBox uipb = (UIPanelBox) component;

        if (!uipb.isRendered()) {
            return;
        }

        String dimensions = "";
        if (uipb.getHeight() > 0) {
            dimensions = "height:" + uipb.getHeight() + "px;";
        }
        if (uipb.getWidth() > 0) {
            dimensions += "width:" + uipb.getWidth() + "px;";
        }

        //Main
        writer.startElement("div", uipb);
        writer.writeAttribute("class", PANELBOX_STYLE + " " + uipb.getStyle(), null);
        writer.writeAttribute("style", dimensions + " " + uipb.getStyle(), null);

        //Header
        writer.startElement("div", uipb);
        writer.writeAttribute("class", PANELBOXHEADER_STYLE + " " + uipb.getHeaderStyleClass(), null);
        writer.writeAttribute("style", uipb.getHeaderStyle(), null);

        writer.startElement("div", uipb);
        writer.writeAttribute("class", PANELBOXHEADERCONTENT_STYLE, null);
        writer.writeAttribute("style", uipb.getHeaderStyle(), null);

        if (uipb.isCollapsible()) {
            writer.startElement("div", uipb);
            writer.writeAttribute("class", PANELBOXTOOLBOX_STYLE, null);

            writer.startElement("div", uipb);
            writer.writeAttribute("id", BUT_PREFIXID + uipb.getId(), null);
            writer.writeAttribute("style", PANELBOX_BUTTON_SIZE, null);
            if (uipb.isCollapseByDefault()) {
                writer.writeAttribute("class", PANELBOX_BUTTON_EXP_STYLE, null);
            } else {
                writer.writeAttribute("class", PANELBOX_BUTTON_COLL_STYLE, null);
            }
            writer.endElement("div");

            writer.endElement("div");
        }

        if (uipb.getTitle() != null) {
            writer.startElement("span", uipb);
            writer.write(uipb.getTitle());
            writer.endElement("span");
        } else if (uipb.getValueExpression("title") != null) {
            String titleValue = uipb.getValueExpression("title").getExpressionString();
            ValueExpression ve = context.getApplication().getExpressionFactory().createValueExpression(context.getELContext(), titleValue, java.lang.String.class);
            String title = (String) ve.getValue(context.getELContext());
            writer.startElement("span", uipb);
            writer.write(title);
            writer.endElement("span");
        }

        writer.endElement("div");

        writer.endElement("div");

        //Content
        writer.startElement("div", uipb);
        writer.writeAttribute("id", CONTENT_PREFIXID + uipb.getId(), null);
        if (uipb.isCollapseByDefault()) {
            writer.writeAttribute("style", "display:none; " + uipb.getContentStyle(), null);
        } else {
            writer.writeAttribute("style", uipb.getContentStyle(), null);
        }

        writer.writeAttribute("class", PANELBOXCONTENT_STYLE + " " + uipb.getContentStyleClass(), null);
    }
View Full Code Here

Examples of org.dekka.component.objectInterface.UIPanelBox

        writer.writeAttribute("class", PANELBOXCONTENT_STYLE + " " + uipb.getContentStyleClass(), null);
    }

    @Override
    public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
        final UIPanelBox uipb = (UIPanelBox) component;

        if (!uipb.isRendered()) {
            return;
        }

        for (final UIComponent tmp : component.getChildren()) {
            FacesContextUtils.encodeRecursive(context, tmp);
View Full Code Here

Examples of org.dekka.component.objectInterface.UIPanelBox

    }

    @Override
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
        final ResponseWriter writer = context.getResponseWriter();
        final UIPanelBox uipb = (UIPanelBox) component;

        if (!uipb.isRendered()) {
            return;
        }

        writer.endElement("div");
        writer.endElement("div");

        if (uipb.isCollapsible()) {
            final StringBuilder script = new StringBuilder();
            script.append("var ").append(CONTENT_PREFIXID).append(uipb.getId()).append(" = $('").append(CONTENT_PREFIXID).append(uipb.getId()).append("'); var ").append(BUT_PREFIXID).append(uipb.getId()).append(" = $('").append(BUT_PREFIXID).append(uipb.getId()).append("');");
            script.append("").append(BUT_PREFIXID).append(uipb.getId()).append(".addEvent('click',function(){");
            script.append("if (").append(BUT_PREFIXID).append(uipb.getId()).append(".get('class') == '").append(PANELBOX_BUTTON_COLL_STYLE).append("'){").append(BUT_PREFIXID).append(uipb.getId()).append(".set('class','").append(PANELBOX_BUTTON_EXP_STYLE).append("');").append(CONTENT_PREFIXID).append(uipb.getId()).append(".style.display ='none';}");
            script.append("else {").append(BUT_PREFIXID).append(uipb.getId()).append(".set('class','").append(PANELBOX_BUTTON_COLL_STYLE).append("');").append(CONTENT_PREFIXID).append(uipb.getId()).append(".style.display ='block';}");
            script.append("});");
            writer.startElement("script", component);
            writer.writeAttribute("type", "text/javascript", null);
            writer.write(script.toString());
            writer.endElement("script");
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.