final UIDL r = (UIDL) i.next();
final Paintable child = client.getPaintable(r);
final Widget widget = (Widget) child;
if (widget.getParent() == this) {
oldWidgets.remove(child);
VCaption vCaption = widgetToCaption.get(child);
if (vCaption != null) {
addOrMove(vCaption, lastIndex++);
oldWidgets.remove(vCaption);
}
}
addOrMove(widget, lastIndex++);
if (mapAttribute != null && mapAttribute.containsKey(r.getId())) {
String css = null;
try {
Style style = widget.getElement().getStyle();
css = mapAttribute.getString(r.getId());
String[] cssRules = css.split(";");
for (int j = 0; j < cssRules.length; j++) {
String[] rule = cssRules[j].split(":");
if (rule.length == 0) {
continue;
} else {
style.setProperty(
makeCamelCase(rule[0].trim()),
rule[1].trim());
}
}
} catch (Exception e) {
VConsole.log("CssLayout encounterd invalid css string: "
+ css);
}
}
if (!r.getBooleanAttribute("cached")) {
child.updateFromUIDL(r, client);
}
}
// loop oldWidgetWrappers that where not re-attached and unregister
// them
for (Widget w : oldWidgets) {
remove(w);
if (w instanceof Paintable) {
final Paintable p = (Paintable) w;
client.unregisterPaintable(p);
}
VCaption vCaption = widgetToCaption.remove(w);
if (vCaption != null) {
remove(vCaption);
}
}
}