From: Matti Tahvonen Date: Mon, 19 Oct 2009 14:14:29 +0000 (+0000) Subject: subwindows now working in 6.2, cleaned some code and docs X-Git-Tag: 6.7.0.beta1~2403 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1225d83fb3f0aaecf542a72fb5c1b77246e4a1ad;p=vaadin-framework.git subwindows now working in 6.2, cleaned some code and docs svn changeset:9246/svn branch:6.2 --- diff --git a/src/com/vaadin/terminal/gwt/client/ui/VView.java b/src/com/vaadin/terminal/gwt/client/ui/VView.java index e9a7588d93..422583cb19 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VView.java @@ -241,26 +241,19 @@ public class VView extends SimplePanel implements Container, ResizeHandler, updateParentFrameSize(); } - // Update subwindows + // Save currently open subwindows to track which will need to be closed final HashSet removedSubWindows = new HashSet( subWindows); - // Open new windows - while ((childUidl = uidl.getChildUIDL(childIndex++)) != null) { - if ("window".equals(childUidl.getTag())) { - final Paintable w = client.getPaintable(childUidl); - if (subWindows.contains(w)) { - removedSubWindows.remove(w); - } else { - subWindows.add((VWindow) w); - } - w.updateFromUIDL(childUidl, client); - } else if ("actions".equals(childUidl.getTag())) { + // 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 (childUidl.getTag().equals("notifications")) { + } else if (tag == "notifications") { for (final Iterator it = childUidl.getChildIterator(); it .hasNext();) { final UIDL notification = (UIDL) it.next(); @@ -269,12 +262,12 @@ public class VView extends SimplePanel implements Container, ResizeHandler, final String parsedUri = client .translateVaadinUri(notification .getStringAttribute("icon")); - html += ""; + html += ""; } if (notification.hasAttribute("caption")) { - html += "

" + html += "

" + notification.getStringAttribute("caption") - + "

"; + + ""; } if (notification.hasAttribute("message")) { html += "

" @@ -290,10 +283,19 @@ public class VView extends SimplePanel implements Container, ResizeHandler, final int delay = notification.getIntAttribute("delay"); new VNotification(delay).show(html, position, style); } + } 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 + // Close old windows which where not in UIDL anymore for (final Iterator rem = removedSubWindows.iterator(); rem .hasNext();) { final VWindow w = rem.next();