Package org.rendersnake.site

Source Code of org.rendersnake.site.ExamplesJQueryPage

package org.rendersnake.site;

import static org.rendersnake.HtmlAttributesFactory.*;

import java.io.IOException;

import org.rendersnake.HtmlCanvas;
import org.rendersnake.Renderable;
import org.rendersnake.site.ipad.AnatomyView;
/**
*
* @author ernestmicklei
*/
public class ExamplesJQueryPage implements Renderable {

    public void renderOn(HtmlCanvas html) throws IOException {
       
        html.getPageContext().set("title","renderSnake - Examples JQuery");
       
        // Use an anonymous defined component to render the examples content
        SiteLayoutWrapper layout = new SiteLayoutWrapper(new SyntaxHighlightingWrapper(this.renderContentOn(html)));
        layout.showSideBar = false;
        html.render(layout);
    }
    /**
     * Return a component that renders the content of the examples page.
     * @param html
     * @return
     * @throws IOException
     */
    private Renderable renderContentOn(final HtmlCanvas html) throws IOException {
        return new Renderable() {

            public void renderOn(HtmlCanvas html) throws IOException {
               
                html
                    .h3().content("JQuery")
                    .p().content("JQuery is supported by providing the classes JQueryAttributes, JQueryAttributesFactory and JQueryLibrary." +
                        "These classes provide convenience methods for attributes to build pages that use JQuery and JQuery Mobile construts.");                   
                         
                html.render(new AnatomyView());
               
                html.p().content("To use these static methods (dataRole,dataTheme,...) you must import the following:");
               
                html.pre(class_("brush: java")).content("import static org.rendersnake.ext.jquery.JQueryAttributesFactory.*;");
               
                html
                    .h1().content("jQuery Mobile - Minimal")
                    .a(href("mobile.html")).content("minimal mobile page");
               
                html
                    .h1().content("jQuery Mobile - Widgets")
                    .a(href("ipad.html")).content("jQuery Mobile widgets");
            }
        };
    }
}
TOP

Related Classes of org.rendersnake.site.ExamplesJQueryPage

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.