Package org.apache.click.element

Examples of org.apache.click.element.CssStyle


                removeVersionIndicator(cssImport, "href");

                add(cssImport);

            } else if (line.startsWith("<style") && line.indexOf("text/css") != -1) {
                CssStyle cssStyle = asCssStyle(lines[i]);
                setUnique(cssStyle, cssStyle.getContent().toString());
                add(cssStyle);

            } else if (line.startsWith("<script")) {
                if (line.indexOf(" src=") != -1) {
                    JsImport jsImport = asJsImport(lines[i]);
View Full Code Here


            buffer.append('\n');
        }

        // Then include all the styles e.g. <style>...</style>
        for (Iterator it = cssStyles.iterator(); it.hasNext();) {
            CssStyle cssStyle = (CssStyle) it.next();
            cssStyle.render(buffer);
            buffer.append('\n');
        }
    }
View Full Code Here

     *
     * @param line the HTML import line to convert to a Css instance
     * @return a Css instance
     */
    private CssStyle asCssStyle(String line) {
        CssStyle cssStyle = new CssStyle();
        copyAttributes(cssStyle, line);
        cssStyle.setContent(extractCssContent(line));
        return cssStyle;
    }
View Full Code Here

            // Add a Css import to the Page
            headElements.add(new CssImport("/general/page-head-demo.css"));

            // Add inline Css content to the Page that increases the field font-size
            headElements.add(new CssStyle("#" + field.getId() + " { font-size: 18px; }"));

            // Add the JQuery library to the Page
            headElements.add(new JsImport("/assets/js/jquery-1.3.2.js"));

            // Add a JQuery template which adds a 'click' listener to the link
View Full Code Here

            headElements.addAll(getControlLink().getHeadElements());
        }

        String tableId = getId();
        CssStyle cssStyle = new CssStyle();
        cssStyle.setId(tableId + "_css_setup");

        if (!headElements.contains(cssStyle)) {
            boolean isDarkStyle = isDarkStyle();

            String contextPath = context.getRequest().getContextPath();
            HtmlStringBuffer buffer = new HtmlStringBuffer(300);
            buffer.append("th.sortable a {\n");
            buffer.append("background: url(");
            buffer.append(contextPath);
            buffer.append("/click/column-sortable-");
            if (isDarkStyle) {
                buffer.append("dark");
            } else {
                buffer.append("light");
            }
            buffer.append(versionIndicator);
            buffer.append(".gif)");
            buffer.append(" center right no-repeat;}\n");
            buffer.append("th.ascending a {\n");
            buffer.append("background: url(");
            buffer.append(contextPath);
            buffer.append("/click/column-ascending-");
            if (isDarkStyle) {
                buffer.append("dark");
            } else {
                buffer.append("light");
            }
            buffer.append(versionIndicator);
            buffer.append(".gif)");
            buffer.append(" center right no-repeat;}\n");
            buffer.append("th.descending a {\n");
            buffer.append("background: url(");
            buffer.append(contextPath);
            buffer.append("/click/column-descending-");
            if (isDarkStyle) {
                buffer.append("dark");
            } else {
                buffer.append("light");
            }
            buffer.append(versionIndicator);
            buffer.append(".gif)");
            buffer.append(" center right no-repeat;}");
            cssStyle.setContent(buffer.toString());
            headElements.add(cssStyle);
        }
        return headElements;
    }
View Full Code Here

            headElements.addAll(getControlLink().getHeadElements());
        }

        String tableId = getId();
        CssStyle cssStyle = new CssStyle();
        cssStyle.setId(tableId + "_css_setup");

        if (!headElements.contains(cssStyle)) {
            boolean isDarkStyle = isDarkStyle();

            String contextPath = context.getRequest().getContextPath();
            HtmlStringBuffer buffer = new HtmlStringBuffer(300);
            buffer.append("th.sortable a {\n");
            buffer.append("background: url(");
            buffer.append(contextPath);
            buffer.append("/click/column-sortable-");
            if (isDarkStyle) {
                buffer.append("dark");
            } else {
                buffer.append("light");
            }
            buffer.append(versionIndicator);
            buffer.append(".gif)");
            buffer.append(" center right no-repeat;}\n");
            buffer.append("th.ascending a {\n");
            buffer.append("background: url(");
            buffer.append(contextPath);
            buffer.append("/click/column-ascending-");
            if (isDarkStyle) {
                buffer.append("dark");
            } else {
                buffer.append("light");
            }
            buffer.append(versionIndicator);
            buffer.append(".gif)");
            buffer.append(" center right no-repeat;}\n");
            buffer.append("th.descending a {\n");
            buffer.append("background: url(");
            buffer.append(contextPath);
            buffer.append("/click/column-descending-");
            if (isDarkStyle) {
                buffer.append("dark");
            } else {
                buffer.append("light");
            }
            buffer.append(versionIndicator);
            buffer.append(".gif)");
            buffer.append(" center right no-repeat;}");
            cssStyle.setContent(buffer.toString());
            headElements.add(cssStyle);
        }
        return headElements;
    }
View Full Code Here

            // Add a Css import to the Page
            headElements.add(new CssImport("/general/page-head-demo.css"));

            // Add inline Css content to the Page that increases the field font-size
            headElements.add(new CssStyle("#" + field.getId() + " { font-size: 18px; }"));

            // Add the JQuery library to the Page
            headElements.add(new JsImport("/assets/js/jquery-1.3.2.js"));

            // Add a JQuery template which adds a 'click' listener to the link
View Full Code Here

            if (line.startsWith("<link") && line.indexOf("text/css") != -1) {
                CssImport cssImport = asCssImport(lines[i]);
                add(cssImport);

            } else if (line.startsWith("<style") && line.indexOf("text/css") != -1) {
                CssStyle cssStyle = asCssStyle(lines[i]);
                setUnique(cssStyle, cssStyle.getContent().toString());
                add(cssStyle);

            } else if (line.startsWith("<script")) {
                if (line.indexOf(" src=") != -1) {
                    JsImport jsImport = asJsImport(lines[i]);
View Full Code Here

            buffer.append('\n');
        }

        // Then include all the styles e.g. <style>...</style>
        for (Iterator it = cssStyles.iterator(); it.hasNext();) {
            CssStyle cssStyle = (CssStyle) it.next();
            cssStyle.render(buffer);
            buffer.append('\n');
        }
    }
View Full Code Here

     *
     * @param line the HTML import line to convert to a Css instance
     * @return a Css instance
     */
    private CssStyle asCssStyle(String line) {
        CssStyle cssStyle = new CssStyle();
        copyAttributes(cssStyle, line);
        cssStyle.setContent(extractCssContent(line));
        return cssStyle;
    }
View Full Code Here

TOP

Related Classes of org.apache.click.element.CssStyle

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.