Package com.astamuse.asta4d.render

Examples of com.astamuse.asta4d.render.Renderer


    // @ShowCode:showRenderertypesEnd

    // @ShowCode:showPassvariablesStart
    public Renderer outer() {
        // 文字列, 整数, Date型の値, List型の値を内部Snippetで使用するためにセットします。
        Renderer render = new GoThroughRenderer();
        render.add("div${symbol_pound}inner", "name", "baz");
        render.add("div${symbol_pound}inner", "age", "30");
        render.add("div${symbol_pound}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${symbol_pound}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${symbol_pound}name span", name);
        render.add("p${symbol_pound}age span", age);
        render.add("p${symbol_pound}currenttime span", DateFormatUtils.format(currenttime, "yyyy/MM/dd HH:mm:ss"));
        render.add("ul${symbol_pound}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${symbol_pound}snippet", snippet);
        Element embed = new EmbedNode("/templates/embed/embedded.html");
        render.add("div${symbol_pound}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${symbol_pound}weatherreport1", "p0", "晴れ");
        } else {
            render.add("afd|msg${symbol_pound}weatherreport1", "p0", "sunny");
        }
        render.add("afd|msg${symbol_pound}weatherreport2", "p0", "cloudy");
        render.add("afd|msg${symbol_pound}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${symbol_pound}name", "value", name);
        }
        if (!StringUtils.isEmpty(age)) {
            renderer.add("input${symbol_pound}age", "value", age);
        }
        if (!StringUtils.isEmpty(nameErrMsg)) {
            renderer.add("span${symbol_pound}nameErrMsg", nameErrMsg);
        }
        if (!StringUtils.isEmpty(ageErrMsg)) {
            renderer.add("span${symbol_pound}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${symbol_pound}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

    }

    // @ShowCode:showCompleteEnd

    public Renderer setHiddenValue(String name, String age, String bloodtype) {
        Renderer renderer = new GoThroughRenderer();
        renderer.add("input${symbol_pound}name", "value", name);
        renderer.add("input${symbol_pound}age", "value", age);
        renderer.add("input${symbol_pound}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${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", Clear);
        render.add("li${symbol_pound}plus", "+class", "red");
        render.add("li${symbol_pound}minus", "-class", "bold");
        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.