Package com.astamuse.asta4d.render

Examples of com.astamuse.asta4d.render.Renderer


            this.interceptor = interceptor;
        }

        @Override
        public boolean beforeProcess(Document doc) throws Exception {
            Renderer renderer = new GoThroughRenderer();
            interceptor.prePageRendering(renderer);
            RenderUtil.apply(doc, renderer);
            return true;
        }
View Full Code Here


        @Override
        public void afterProcess(Document doc, ExceptionHandler exceptionHandler) {
            if (exceptionHandler.getException() != null) {
                return;
            }
            Renderer renderer = new GoThroughRenderer();
            interceptor.postPageRendering(renderer);
            RenderUtil.apply(doc, renderer);
        }
View Full Code Here

    public void submitWithContext(final Context context, final String snippetRef, final Callable<Renderer> caller) {
        cs.submit(new Callable<FutureRendererHolder>() {
            @Override
            public FutureRendererHolder call() throws Exception {
                Renderer renderer = Context.with(context, caller);
                return new FutureRendererHolder(snippetRef, renderer);
            }
        });
        executionCount++;
    }
View Full Code Here

            this.interceptor = interceptor;
        }

        @Override
        public boolean beforeProcess(Document doc) throws Exception {
            Renderer renderer = new GoThroughRenderer();
            interceptor.prePageRendering(renderer);
            RenderUtil.apply(doc, renderer);
            return true;
        }
View Full Code Here

        @Override
        public void afterProcess(Document doc, ExceptionHandler exceptionHandler) {
            if (exceptionHandler.getException() != null) {
                return;
            }
            Renderer renderer = new GoThroughRenderer();
            interceptor.postPageRendering(renderer);
            RenderUtil.apply(doc, renderer);
        }
View Full Code Here

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

    // @ShowCode:showVariableinjectionEnd
    public Renderer setProfile() {
        Renderer render = new GoThroughRenderer();
        render.add("p${symbol_pound}name span", "asta4d");
        render.add("p${symbol_pound}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${symbol_pound}name span", name);
        render.add("p${symbol_pound}age span", age);
        return render;
    }
View Full Code Here

    }

    // @ShowCode:showVariableinjectionEnd
    // @ShowCode:showAttributevaluesStart
    public Renderer manipulateAttrValues() {
        Renderer render = new GoThroughRenderer();
        render.add("input${symbol_pound}yes", "checked", "checked");
        render.add("button${symbol_pound}delete", "disabled", null);
        render.add("li${symbol_pound}plus", "+class", "red");
        render.add("li${symbol_pound}minus", "-class", "bold");
        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", new ClearNode());

        // レンダリング結果をデバッグ出力します。
        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

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.