Examples of addIfExists()


Examples of org.apache.struts2.views.java.Attributes.addIfExists()

        end("li");
    }

    private void startUL(Map<String, Object> params) throws IOException {
        Attributes attrs = new Attributes();
        attrs.addIfExists("style", params.get("cssStyle"))
                .add("class", params.containsKey("cssClass") ? (String) params.get("cssClass") : "errorMessage");
        start("ul", attrs);
    }
}
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

        super.end("select");
    }

    private void writeOption(String value, String text, boolean selected) throws IOException {
        Attributes attrs = new Attributes();
        attrs.addIfExists("value", value)
                .addIfTrue("selected", selected);

        start("option", attrs);
        characters(text);
        end("option");
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

    }

    private void writeOptionGroup(ListUIBean listUIBean, Object value) throws IOException {
        Map params = listUIBean.getParameters();
        Attributes attrs = new Attributes();
        attrs.addIfExists("label", params.get("label"))
                .addIfTrue("disabled", params.get("disabled"));
        start("optgroup", attrs);

        //options
        ValueStack stack = context.getStack();
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

        public void generate() throws IOException {
            Map<String, Object> params = context.getParameters();

            Attributes attrs = new Attributes();

            attrs.addIfExists("name", params.get("name"))
                    .addIfExists("id", params.get("id"))
                    .addIfExists("class", params.get("cssClass"))
                    .addIfExists("style", params.get("cssStyle"))
                    .addIfExists("href", params.get("href"), false)
                    .addIfExists("title", params.get("title"))
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

public class DivHandler extends AbstractTagHandler implements TagGenerator {
    public void generate() throws IOException {
        Map<String, Object> params = context.getParameters();
        Attributes attrs = new Attributes();
        attrs.addIfExists("name", params.get("name"))
                .addIfExists("id", params.get("id"))
                .addIfExists("class", params.get("cssClass"))
                .addIfExists("style", params.get("cssStyle"))
                .addIfExists("title", params.get("title"));
        start("div", attrs);
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

        Attributes attrs = new Attributes();

        String type = TextUtils.noNull((String) params.get("type"), "input");

        if ("button".equals(type)) {
            attrs.addIfExists("name", params.get("name"))
                    .add("type", "submit")
                    .addIfExists("value", params.get("nameValue"), false)
                    .addIfTrue("disabled", params.get("disabled"))
                    .addIfExists("tabindex", params.get("tabindex"))
                    .addIfExists("id", params.get("id"))
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

                    .addIfExists("class", params.get("cssClass"))
                    .addIfExists("style", params.get("cssStyle"));

            start("button", attrs);
        } else if ("image".equals(type)) {
            attrs.addIfExists("src", params.get("src"), false)
                    .add("type", "image")
                    .addIfExists("alt", params.get("label"));

            start("input", attrs);
        } else {
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

                    .add("type", "image")
                    .addIfExists("alt", params.get("label"));

            start("input", attrs);
        } else {
            attrs.addIfExists("name", params.get("name"))
                    .add("type", "submit")
                    .addIfExists("value", params.get("nameValue"), false)
                    .addIfTrue("disabled", params.get("disabled"))
                    .addIfExists("tabindex", params.get("tabindex"))
                    .addIfExists("id", params.get("id"))
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

public class AnchorHandler extends AbstractTagHandler implements TagGenerator {
    public void generate() throws IOException {
        Map<String, Object> params = context.getParameters();
        Attributes attrs = new Attributes();

        attrs.addIfExists("name", params.get("name"))
                .addIfExists("id", params.get("id"))
                .addIfExists("class", params.get("cssClass"))
                .addIfExists("style", params.get("cssStyle"))
                .addIfExists("href", params.get("href"), false)
                .addIfExists("title", params.get("title"))
View Full Code Here

Examples of org.apache.struts2.views.java.Attributes.addIfExists()

                .addIfExists("id", params.get("id"))
                .addIfExists("class", params.get("cssClass"))
                .addIfExists("style", params.get("cssStyle"));

        if (!isButton)
            attrs.addIfExists("title", params.get("title"));

        super.start("input", attrs);
        if (isButton) {
            String label = (String) params.get("label");
            if (TextUtils.stringSet(label))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.