return;
}
// Draw this application level window
UIDL childUidl = uidl.getChildUIDL(childIndex);
final Paintable lo = client.getPaintable(childUidl);
if (layout != null) {
if (layout != lo) {
// remove old
client.unregisterPaintable(layout);
// add new
setWidget((Widget) lo);
layout = lo;
}
} else {
setWidget((Widget) lo);
layout = lo;
}
layout.updateFromUIDL(childUidl, client);
if (!childUidl.getBooleanAttribute("cached")) {
updateParentFrameSize();
}
// Save currently open subwindows to track which will need to be closed
final HashSet<VWindow> removedSubWindows = new HashSet<VWindow>(
subWindows);
// Handle other UIDL children
while ((childUidl = uidl.getChildUIDL(++childIndex)) != null) {
String tag = childUidl.getTag().intern();
if (tag == "actions") {
if (actionHandler == null) {
actionHandler = new ShortcutActionHandler(id, client);
}
actionHandler.updateActionMap(childUidl);
} else if (tag == "execJS") {
String script = childUidl.getStringAttribute("script");
eval(script);
} else if (tag == "notifications") {
for (final Iterator<?> it = childUidl.getChildIterator(); it
.hasNext();) {
final UIDL notification = (UIDL) it.next();
VNotification.showNotification(client, notification);
}
} else {
// subwindows
final Paintable w = client.getPaintable(childUidl);
if (subWindows.contains(w)) {
removedSubWindows.remove(w);
} else {
subWindows.add((VWindow) w);
}
w.updateFromUIDL(childUidl, client);
}
}
// Close old windows which where not in UIDL anymore
for (final Iterator<VWindow> rem = removedSubWindows.iterator(); rem
.hasNext();) {
final VWindow w = rem.next();
client.unregisterPaintable(w);
subWindows.remove(w);
w.hide();
}
if (uidl.hasAttribute("focused")) {
// set focused component when render phase is finished
Scheduler.get().scheduleDeferred(new Command() {
public void execute() {
final Paintable toBeFocused = uidl.getPaintableAttribute(
"focused", connection);
/*
* Two types of Widgets can be focused, either implementing
* GWT HasFocus of a thinner Vaadin specific Focusable