Package net.sf.json

Examples of net.sf.json.JSONObject.element()


    public JSONObject toJson(MessageSource messages, Locale locale) {
        JSONObject json = new JSONObject();
        json.element("type", getType());
        json.element("readonly", isReadonly());
        json.element("mandatory", isMandatory());
        json.element("onchange", getOnChange());

        String obligatoryMark = "";
        if (isMandatory()) {
            obligatoryMark = "*";
        }
View Full Code Here


        String obligatoryMark = "";
        if (isMandatory()) {
            obligatoryMark = "*";
        }
        json.element("name", "values[" + getName() + "]");
        if (messages != null) {
            if (label != null) {
                json.element("label", messages.getMessage(getLabel(), null, locale) + obligatoryMark);
            } else {
                json.element("label", labelText + obligatoryMark);
View Full Code Here

            obligatoryMark = "*";
        }
        json.element("name", "values[" + getName() + "]");
        if (messages != null) {
            if (label != null) {
                json.element("label", messages.getMessage(getLabel(), null, locale) + obligatoryMark);
            } else {
                json.element("label", labelText + obligatoryMark);
            }
        } else {
            if (label != null) {
View Full Code Here

        json.element("name", "values[" + getName() + "]");
        if (messages != null) {
            if (label != null) {
                json.element("label", messages.getMessage(getLabel(), null, locale) + obligatoryMark);
            } else {
                json.element("label", labelText + obligatoryMark);
            }
        } else {
            if (label != null) {
                json.element("label", getLabel() + obligatoryMark);
            } else {
View Full Code Here

            } else {
                json.element("label", labelText + obligatoryMark);
            }
        } else {
            if (label != null) {
                json.element("label", getLabel() + obligatoryMark);
            } else {
                json.element("label", labelText + obligatoryMark);
            }
        }
        if (value != null) {
View Full Code Here

            }
        } else {
            if (label != null) {
                json.element("label", getLabel() + obligatoryMark);
            } else {
                json.element("label", labelText + obligatoryMark);
            }
        }
        if (value != null) {
            json.element("value", value);
        }
View Full Code Here

            } else {
                json.element("label", labelText + obligatoryMark);
            }
        }
        if (value != null) {
            json.element("value", value);
        }
        return json;
    }

    public String getValue() {
View Full Code Here

    private void createMenu(JSONArray jmenu, Collection<MenuItem> items) {
        for (MenuItem item : items) {
            JSONObject jitem = new JSONObject();
            jmenu.element(jitem);
            jitem.element("selected", item.isSelected());
            jitem.element("url", item.getAction());
            jitem.element("name", item.getName());
            jitem.element("namespace", item.getNamespace());
            jitem.element("jsp", item.isJsp());
        }
View Full Code Here

    private void createMenu(JSONArray jmenu, Collection<MenuItem> items) {
        for (MenuItem item : items) {
            JSONObject jitem = new JSONObject();
            jmenu.element(jitem);
            jitem.element("selected", item.isSelected());
            jitem.element("url", item.getAction());
            jitem.element("name", item.getName());
            jitem.element("namespace", item.getNamespace());
            jitem.element("jsp", item.isJsp());
        }
    }
View Full Code Here

        for (MenuItem item : items) {
            JSONObject jitem = new JSONObject();
            jmenu.element(jitem);
            jitem.element("selected", item.isSelected());
            jitem.element("url", item.getAction());
            jitem.element("name", item.getName());
            jitem.element("namespace", item.getNamespace());
            jitem.element("jsp", item.isJsp());
        }
    }
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.