Package com.astamuse.asta4d.render

Examples of com.astamuse.asta4d.render.Renderer


    }

    // @ShowCode:showCompleteEnd

    public Renderer setHiddenValue(String name, String age, String bloodtype) {
        Renderer renderer = new GoThroughRenderer();
        renderer.add("input#name", "value", name);
        renderer.add("input#age", "value", age);
        renderer.add("input#bloodtype", "value", bloodtype);
        return renderer;
    }
View Full Code Here


        return Renderer.create("*", element);
    }

    // @ShowCode:showVariableinjectionEnd
    public Renderer setProfile() {
        Renderer render = new GoThroughRenderer();
        render.add("p#name span", "asta4d");
        render.add("p#age span", 20);
        return render;
    }
View Full Code Here

    // @ShowCode:showSnippetEnd

    // @ShowCode:showVariableinjectionStart
    public Renderer setProfileByVariableInjection(String name, int age) {
        Renderer render = new GoThroughRenderer();
        render.add("p#name span", name);
        render.add("p#age span", age);
        return render;
    }
View Full Code Here

    }

    // @ShowCode:showVariableinjectionEnd
    // @ShowCode:showAttributevaluesStart
    public Renderer manipulateAttrValues() {
        Renderer render = new GoThroughRenderer();
        render.add("input#yes", "checked", "checked");
        render.add("button#delete", "disabled", Clear);
        render.add("li#plus", "+class", "red");
        render.add("li#minus", "-class", "bold");
        return render;
    }
View Full Code Here

    private static final String JAVA_PACKAGE = "/com/astamuse/asta4d/sample";
    private static final String VM_ARG = "asta4d.sample.source_location";
    private static final String SHOW_MARK = "@ShowCode:";

    public Renderer showCode(HttpServletRequest request, String file, String startMark, String endMark, String title) {
        Renderer render = new GoThroughRenderer();
        ServletContext servletContext = request.getSession().getServletContext();
        String contents = readFileByLines(servletContext, file, SHOW_MARK + startMark, SHOW_MARK + endMark);
        render.add("div", makeShowHtml(file, title, contents));

        return render;
    }
View Full Code Here

public class ComplicatedSnippet {

    // @ShowCode:showRenderertypesStart
    public Renderer render() {
        // それ自体は何もしない Renderer です。
        Renderer render = new GoThroughRenderer();

        // 該当 Element の子要素全てを置換します。

        ChildReplacer replacer = new ChildReplacer(createElement());
        render.add("ul#childreplacer", replacer);

        // 該当 Element を削除します。
        render.add("ul#clearnode", Clear);

        // レンダリング結果をデバッグ出力します。
        render.addDebugger("current element");

        return render;
    }
View Full Code Here

    // @ShowCode:showRenderertypesEnd

    // @ShowCode:showPassvariablesStart
    public Renderer outer() {
        // 文字列, 整数, Date型の値, List型の値を内部Snippetで使用するためにセットします。
        Renderer render = new GoThroughRenderer();
        render.add("div#inner", "name", "baz");
        render.add("div#inner", "age", "30");
        render.add("div#inner", "currenttime", new Date());

        List<String> list = new ArrayList<>();
        list.add("This text is passed by outer snippet.(1)");
        list.add("This text is passed by outer snippet.(2)");
        list.add("This text is passed by outer snippet.(3)");
        render.add("div#inner", "list", list);
        return render;
    }
View Full Code Here

        return render;
    }

    public Renderer inner(String name, int age, Date currenttime, List<String> list) {
        // 外部Snippetでセットされた値を変数から取得し、使用します。
        Renderer render = new GoThroughRenderer();
        render.add("p#name span", name);
        render.add("p#age span", age);
        render.add("p#currenttime span", DateFormatUtils.format(currenttime, "yyyy/MM/dd HH:mm:ss"));
        render.add("ul#list li", list);
        return render;
    }
View Full Code Here

    private static final String JAVA_PACKAGE = "/${packageInPathFormat}";
    private static final String VM_ARG = "asta4d.sample.source_location";
    private static final String SHOW_MARK = "@ShowCode:";

    public Renderer showCode(HttpServletRequest request, String file, String startMark, String endMark, String title) {
        Renderer render = new GoThroughRenderer();
        ServletContext servletContext = request.getSession().getServletContext();
        String contents = readFileByLines(servletContext, file, SHOW_MARK + startMark, SHOW_MARK + endMark);
        render.add("div", makeShowHtml(file, title, contents));

        return render;
    }
View Full Code Here

public class ComplicatedSnippet {

    // @ShowCode:showRenderertypesStart
    public Renderer render() {
        // それ自体は何もしない Renderer です。
        Renderer render = new GoThroughRenderer();

        // 該当 Element の子要素全てを置換します。

        ChildReplacer replacer = new ChildReplacer(createElement());
        render.add("ul${symbol_pound}childreplacer", replacer);

        // 該当 Element を削除します。
        render.add("ul${symbol_pound}clearnode", Clear);

        // レンダリング結果をデバッグ出力します。
        render.addDebugger("current element");

        return render;
    }
View Full Code Here

TOP

Related Classes of com.astamuse.asta4d.render.Renderer

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.