Package org.apache.click.element

Examples of org.apache.click.element.JsImport


                setUnique(cssStyle, cssStyle.getContent().toString());
                add(cssStyle);

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

                    // Remove Click's version indicator from src attribute
                    removeVersionIndicator(jsImport, "src");
                    add(jsImport);
View Full Code Here


     * @param buffer the specified buffer to render the page's HTML imports to
     */
    protected void renderJsElements(HtmlStringBuffer buffer) {
        // First include all the imports e.g. <script src="...">
        for (Iterator it = jsImports.iterator(); it.hasNext();) {
            JsImport jsImport = (JsImport) it.next();
            jsImport.render(buffer);
            buffer.append('\n');
        }

        // Then include all the scripts e.g. <script>...</script>
        for (Iterator it = jsScripts.iterator(); it.hasNext();) {
View Full Code Here

     *
     * @param line the HTML import line to convert to a JavaScriptImport instance
     * @return a JavascriptImport instance
     */
    private JsImport asJsImport(String line) {
        JsImport jsImport = new JsImport();
        copyAttributes(jsImport, line);
        return jsImport;
    }
View Full Code Here

        if (headElements == null) {
            headElements = super.getHeadElements();

            // Include the prototype.js library which is made available under
            // the web folder "/click/prototype/"
            headElements.add(new JsImport("/click/prototype/prototype.js"));

            Context context = getContext();

            // Create a model to pass to the Page JavaScript template. The
            // template recognizes the following Velocity variables:
View Full Code Here

    public List getHeadElements() {
        if (headElements == null) {
            headElements = super.getHeadElements();

            headElements.add(new CssImport("/assets/css/imports.css"));
            headElements.add(new JsImport("/assets/js/imports.js"));
            headElements.add(new JsScript("addLoadEvent(function() { initMenu(); });"));
        }
        return headElements;
    }
View Full Code Here

            // 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
            // that will show/hide the field
            Context context = getContext();
View Full Code Here

        public List getHeadElements() {
            if (headElements == null) {
                headElements = super.getHeadElements();

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

                // Add the Rating JavaScript library to the control
                headElements.add(new JsImport("/assets/rating/jquery.rating.js"));

                // Add the Rating Css to the control
                headElements.add(new CssImport("/assets/rating/jquery.rating.css"));
            }
            return headElements;
View Full Code Here

        // Lazily load head elements and ensure they are only loaded once
        if (headElements == null) {
            headElements = super.getHeadElements();

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

            // Create a default model and add the pageSize variable to pass to
            // the JavaScript template: ajax-live-scroller.js
            Map model = ClickUtils.createTemplateModel(this, getContext());
            model.put("pageSize", pageSize);
View Full Code Here

        if (headElements == null) {
            headElements = super.getHeadElements();

            // Include the prototype.js library which is made available under
            // the web folder "/click/prototype/"
            headElements.add(new JsImport("/click/prototype/prototype.js"));

            Context context = getContext();

            // Create a model to pass to the Page JavaScript template. The
            // template recognizes the following Velocity variables:
View Full Code Here

        // Lazily load head elements
        if (headElements == null) {
            headElements = super.getHeadElements();

            headElements.add(new JsImport("/assets/js/jquery-1.3.2.js"));
            headElements.add(new JsImport("/assets/js/jquery.tools.min.js"));
            headElements.add(new CssImport("/assets/css/tabs-accordion.css"));

            // Note the actual JavaScript necessary to setup the accordion is
            // specified in the Page JavaScript template -> ajax-accordion.js.
            headElements.add(new JsScript("/ajax/ajax-accordion.js", new HashMap()));
View Full Code Here

TOP

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

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.