Package com.astamuse.asta4d.render

Examples of com.astamuse.asta4d.render.Renderer


        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


    }

    // @ShowCode:showPassvariablesEnd
    // @ShowCode:showDynamicsnippetStart
    public Renderer createDynamicSnippet() {
        Renderer render = new GoThroughRenderer();
        Element snippet = new SnippetNode("SimpleSnippet");
        snippet.attr("name", "Dynamic Snippet");
        render.add("div#snippet", snippet);
        Element embed = new EmbedNode("/templates/embed/embedded.html");
        render.add("div#embed", embed);
        return render;
    }
View Full Code Here

    }

    // @ShowCode:showContextdataEnd
    // @ShowCode:showLocalizeStart
    public Renderer setWeatherreportParam() {
        Renderer render = new GoThroughRenderer();
        Locale locale = Context.getCurrentThreadContext().getCurrentLocale();
        if (locale.equals(Locale.JAPANESE) || locale.equals(Locale.JAPAN)) {
            render.add("afd|msg#weatherreport1", "p0", "晴れ");
        } else {
            render.add("afd|msg#weatherreport1", "p0", "sunny");
        }
        render.add("afd|msg#weatherreport2", "p0", "cloudy");
        render.add("afd|msg#weatherreport3", "p0", "rain");
        return render;
    }
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

    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

    }

    // @ShowCode:showPassvariablesEnd
    // @ShowCode:showDynamicsnippetStart
    public Renderer createDynamicSnippet() {
        Renderer render = new GoThroughRenderer();
        Element snippet = new SnippetNode("SimpleSnippet");
        snippet.attr("name", "Dynamic Snippet");
        render.add("div#snippet", snippet);
        Element embed = new EmbedNode("/templates/embed/embedded.html");
        render.add("div#embed", embed);
        return render;
    }
View Full Code Here

    }

    // @ShowCode:showContextdataEnd
    // @ShowCode:showLocalizeStart
    public Renderer setWeatherreportParam() {
        Renderer render = new GoThroughRenderer();
        Locale locale = Context.getCurrentThreadContext().getCurrentLocale();
        if (locale.equals(Locale.JAPANESE) || locale.equals(Locale.JAPAN)) {
            render.add("afd|msg#weatherreport1", "p0", "晴れ");
        } else {
            render.add("afd|msg#weatherreport1", "p0", "sunny");
        }
        render.add("afd|msg#weatherreport2", "p0", "cloudy");
        render.add("afd|msg#weatherreport3", "p0", "rain");
        return render;
    }
View Full Code Here

    // @ShowCode:showCompleteEnd
    // @ShowCode:showInputEnd

    // @ShowCode:showInputStart
    public Renderer setInitValue(String name, String age, String bloodtype, String nameErrMsg, String ageErrMsg) {
        Renderer renderer = new GoThroughRenderer();
        if (!StringUtils.isEmpty(name)) {
            renderer.add("input#name", "value", name);
        }
        if (!StringUtils.isEmpty(age)) {
            renderer.add("input#age", "value", age);
        }
        if (!StringUtils.isEmpty(nameErrMsg)) {
            renderer.add("span#nameErrMsg", nameErrMsg);
        }
        if (!StringUtils.isEmpty(ageErrMsg)) {
            renderer.add("span#ageErrMsg", ageErrMsg);
        }
        List<Renderer> options = new ArrayList<>();
        for (BloodType bloodTypeEnum : BloodType.values()) {
            Renderer type = Renderer.create("option", "value", bloodTypeEnum.name());
            type.add("option", bloodTypeEnum.name());
            if (bloodTypeEnum.name().equals(bloodtype)) {
                type.add("option", "selected", "selected");
            }
            options.add(type);
        }
        renderer.add("select#bloodtype > option", options);
        return renderer;
View Full Code Here

    // @ShowCode:showInputEnd

    // @ShowCode:showConfirmStart
    // @ShowCode:showCompleteStart
    public Renderer setInputValue(String name, String age, String bloodtype) {
        Renderer renderer = new GoThroughRenderer();
        renderer.add("dd.name", name);
        renderer.add("dd.age", age);
        renderer.add("dd.bloodtype", BloodType.valueOf(bloodtype).name());
        return renderer;
    }
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.