From: Henri Sara Date: Wed, 25 Jan 2012 12:07:56 +0000 (+0200) Subject: Resolve some merge conflicts. X-Git-Tag: 7.0.0.alpha2~440^2~34 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=24055b4ccaf6b51ac89badb9620e882ef874c5b8;p=vaadin-framework.git Resolve some merge conflicts. --- diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index bcbe0de22c..a3cf20ae28 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -954,8 +954,9 @@ public class Util { Object value = parameters[1]; // TODO paintables inside lists/maps get rendered as // components in the debug console - String formattedValue = value instanceof Paintable ? c - .getPid((Paintable) value) : String.valueOf(value); + String formattedValue = value instanceof VPaintable ? c + .getPaintableMap().getPid((VPaintable) value) + : String.valueOf(value); formattedParams = parameters[0] + " : " + formattedValue; } if (null == formattedParams) { diff --git a/src/com/vaadin/terminal/gwt/client/communication/JsonEncoder.java b/src/com/vaadin/terminal/gwt/client/communication/JsonEncoder.java index a4aaee1a61..6f429df30c 100644 --- a/src/com/vaadin/terminal/gwt/client/communication/JsonEncoder.java +++ b/src/com/vaadin/terminal/gwt/client/communication/JsonEncoder.java @@ -8,7 +8,8 @@ import com.google.gwt.json.client.JSONNull; import com.google.gwt.json.client.JSONObject; import com.google.gwt.json.client.JSONString; import com.google.gwt.json.client.JSONValue; -import com.vaadin.terminal.gwt.client.Paintable; +import com.vaadin.terminal.gwt.client.VPaintable; +import com.vaadin.terminal.gwt.client.VPaintableMap; /** * Encoder for converting RPC parameters and other values to JSON for transfer @@ -45,15 +46,11 @@ public class JsonEncoder { * * @param value * value to convert - * @param paintableMapper + * @param paintableMap * mapper from paintables to paintable IDs * @return JSON representation of the value */ - public static JSONValue encode(Object value, - PaintableIdMapper paintableMapper) { - char type = getTransportType(value); - Object encodedValue = null; - + public static JSONValue encode(Object value, VPaintableMap paintableMap) { if (null == value) { // TODO as undefined type? return combineTypeAndValue(VTYPE_UNDEFINED, JSONNull.getInstance()); @@ -75,7 +72,7 @@ public class JsonEncoder { JSONArray jsonArray = new JSONArray(); for (int i = 0; i < array.length; ++i) { // TODO handle object graph loops? - jsonArray.set(i, encode(array[i], paintableMapper)); + jsonArray.set(i, encode(array[i], paintableMap)); } return combineTypeAndValue(VTYPE_ARRAY, jsonArray); } else if (value instanceof Map) { @@ -85,13 +82,13 @@ public class JsonEncoder { for (String mapKey : map.keySet()) { // TODO handle object graph loops? Object mapValue = map.get(mapKey); - jsonMap.put(mapKey, encode(mapValue, paintableMapper)); + jsonMap.put(mapKey, encode(mapValue, paintableMap)); } return combineTypeAndValue(VTYPE_MAP, jsonMap); - } else if (value instanceof Paintable) { - Paintable paintable = (Paintable) value; + } else if (value instanceof VPaintable) { + VPaintable paintable = (VPaintable) value; return combineTypeAndValue(VTYPE_PAINTABLE, new JSONString( - paintableMapper.getPid(paintable))); + paintableMap.getPid(paintable))); } else { return combineTypeAndValue(getTransportType(value), new JSONString( String.valueOf(value))); @@ -108,7 +105,7 @@ public class JsonEncoder { private static char getTransportType(Object value) { if (value instanceof String) { return VTYPE_STRING; - } else if (value instanceof Paintable) { + } else if (value instanceof VPaintable) { return VTYPE_PAINTABLE; } else if (value instanceof Boolean) { return VTYPE_BOOLEAN;