Search in sources :

Example 6 with ComponentTypeSabloValue

use of com.servoy.j2db.server.ngclient.property.ComponentTypeSabloValue in project servoy-client by Servoy.

the class FormComponentSabloValue method changesToJSON.

public void changesToJSON(JSONWriter writer, DataConversion clientConversion, FormComponentPropertyType formComponentPropertyType) {
    clientConversion.convert(FormComponentPropertyType.TYPE_NAME);
    writer.object();
    writer.key("childElements");
    writer.array();
    DataConversion componentConversionMarkers = new DataConversion();
    componentConversionMarkers.pushNode("childElements");
    ComponentTypeSabloValue[] components = getComponents();
    for (int i = 0; i < components.length; i++) {
        componentConversionMarkers.pushNode(String.valueOf(i));
        components[i].changesToJSON(writer, componentConversionMarkers, ComponentPropertyType.INSTANCE);
        componentConversionMarkers.popNode();
    }
    componentConversionMarkers.popNode();
    writer.endArray();
    if (componentConversionMarkers.getConversions().size() > 0) {
        writer.key(JSONUtils.TYPES_KEY).object();
        JSONUtils.writeConversions(writer, componentConversionMarkers.getConversions());
        writer.endObject();
    }
    writer.endObject();
}
Also used : DataConversion(org.sablo.websocket.utils.DataConversion) ComponentTypeSabloValue(com.servoy.j2db.server.ngclient.property.ComponentTypeSabloValue)

Aggregations

ComponentTypeSabloValue (com.servoy.j2db.server.ngclient.property.ComponentTypeSabloValue)6 ArrayList (java.util.ArrayList)2 JSONObject (org.json.JSONObject)2 PropertyDescription (org.sablo.specification.PropertyDescription)2 DataConversion (org.sablo.websocket.utils.DataConversion)2 Form (com.servoy.j2db.persistence.Form)1 FormElement (com.servoy.j2db.server.ngclient.FormElement)1 FormComponentCache (com.servoy.j2db.server.ngclient.FormElementHelper.FormComponentCache)1 INGFormElement (com.servoy.j2db.server.ngclient.INGFormElement)1 ComponentTypeFormElementValue (com.servoy.j2db.server.ngclient.property.ComponentTypeFormElementValue)1 List (java.util.List)1 ScriptableObject (org.mozilla.javascript.ScriptableObject)1 PropertyDescriptionBuilder (org.sablo.specification.PropertyDescriptionBuilder)1