Package org.rendersnake

Examples of org.rendersnake.RenderableAttribute


    /**
     * Return the HTML snippet to replace the reference in a template
     */
    public String toString(Object o) {
        RenderableAttribute cc = (RenderableAttribute)o;
        HtmlCanvas attributeCanvas = cc.getCanvas();
        HtmlCanvas localCanvas = attributeCanvas.createLocalCanvas();
        localCanvas.getPageContext().attributes = attributeCanvas.getPageContext().attributes;
        try {
            cc.getComponent().renderOn(localCanvas);
        } catch (IOException e) {
            return "RenderableAttributeRenderer-ERROR:" + e.getMessage();
        }
        return localCanvas.toHtml();
    }
View Full Code Here


        HtmlCanvas html = new HtmlCanvas();
       
        html.getPageContext().set("timestamp", new Date().toString());
       
        PersonUI ui = new PersonUI(new Person());
        html.getPageContext().set("person", new RenderableAttribute(html,ui));
       
        html.render(StringTemplate.get("templates/wrapper.html"));
        System.out.println(html.toHtml());
    }        
View Full Code Here

TOP

Related Classes of org.rendersnake.RenderableAttribute

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.