Package org.richfaces.component

Examples of org.richfaces.component.AbstractPage


    public boolean hasFacet(UIComponent component, String facet) {
        return null != component.getFacet(facet);
    }

    public boolean hasTitle(FacesContext context, UIComponent component) {
        AbstractPage page = (AbstractPage) component;
        String pageTitle = page.getPageTitle();
        return pageTitle != null && !pageTitle.trim().equals("");
    }
View Full Code Here


    }

    public void pageStyle(FacesContext context, UIComponent component)
            throws IOException {
        // Write body class.
        AbstractPage page = (AbstractPage) component;
        ResponseWriter writer = context.getResponseWriter();
        writer.startElement("style", component);
        writer.writeAttribute(HtmlConstants.TYPE_ATTR, HtmlConstants.CSS_TYPE, null);
        // Calculate page width
        Integer width = page.getWidth();
        if (null != width && width > 0) {
            float nonIeWidth = (width.floatValue() / 13.0f);
            float ieWidth = (width.floatValue() / 13.333f);
            StringBuilder format = new StringBuilder(
                    ".rf-pg{margin:auto;text-align:left;");
            format.append("width:").append(nonIeWidth).append("em;");
            format.append("*width:").append(ieWidth).append("em;\n");
            format.append("}\n");
            writer.write(format.toString());
        } else {
            writer.write(".rf-pg{margin:auto 10px;width:auto;}\n");
        }
        // Calculate sidebar width
        if (component.getFacet("sidebar") != null) {
            LayoutPosition sidebarPosition = page.getSidebarPosition();
            if (LayoutPosition.right.equals(sidebarPosition)) {
                writer
                        .write(".rf-pg-m{float:left;margin-right:-30em;}\n");
            } else {
                writer
                        .write(".rf-pg-m{float:right;margin-left:-30em;}\n");
                sidebarPosition = LayoutPosition.left;
            }
            Integer sidebarWidth = page.getSidebarWidth();
            if (null != sidebarWidth && sidebarWidth > 0) {
                float nonIeWidth = (sidebarWidth.floatValue() / 13.0f);
                float ieWidth = (sidebarWidth.floatValue() / 13.333f);
                StringBuilder format = new StringBuilder(
                        ".rf-pg-sb{float:");
View Full Code Here

    }

    public String prolog(FacesContext context, UIComponent component)
            throws IOException {
        ResponseWriter out = context.getResponseWriter();
        AbstractPage page = (AbstractPage) component;
        String format = page.getMarkupType();
        String contentType = page.getContentType();
        String namespace = page.getNamespace();
        // String characterEncoding = out.getCharacterEncoding();
        String[] docType = null;
        if (null != format) {
            docType = doctypes.get(format);
        } else {
View Full Code Here

TOP

Related Classes of org.richfaces.component.AbstractPage

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.