Search in sources :

Example 1 with FormatPropertyType

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

the class FoundsetTypeSabloValue method writeColumnFormatsIfNeededAndAvailable.

protected void writeColumnFormatsIfNeededAndAvailable(JSONWriter destinationJSON, IBrowserConverterContext dataConverterContext, boolean update) throws JSONException {
    if (specConfig.sendDefaultFormats) {
        destinationJSON.key((update ? UPDATE_PREFIX : "") + COLUMN_FORMATS).object();
        if (columnFormats != null) {
            // just get it nicely in case it's overridden in designer for example
            FormatPropertyType formatPropertyType = (FormatPropertyType) TypesRegistry.getType(FormatPropertyType.TYPE_NAME);
            for (Entry<String, ComponentFormat> columnFormat : columnFormats.entrySet()) {
                formatPropertyType.writeComponentFormatToJSON(destinationJSON, columnFormat.getKey(), columnFormat.getValue(), null, dataConverterContext);
            }
        }
        // else just an empty object if fine (but we do write it because when changing dataproviders from scripting it could change from something to null and the client should know about it)
        destinationJSON.endObject();
    }
}
Also used : FormatPropertyType(com.servoy.j2db.server.ngclient.property.types.FormatPropertyType) ComponentFormat(com.servoy.j2db.component.ComponentFormat)

Aggregations

ComponentFormat (com.servoy.j2db.component.ComponentFormat)1 FormatPropertyType (com.servoy.j2db.server.ngclient.property.types.FormatPropertyType)1