summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2009-10-19 14:14:29 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2009-10-19 14:14:29 +0000
commit1225d83fb3f0aaecf542a72fb5c1b77246e4a1ad (patch)
tree81fdcf6de4d7802e80626ae1fd51faaddb9df536 /src/com
parentb26bec94b51103a0030658691f2669bfe9c44b1c (diff)
downloadvaadin-framework-1225d83fb3f0aaecf542a72fb5c1b77246e4a1ad.tar.gz
vaadin-framework-1225d83fb3f0aaecf542a72fb5c1b77246e4a1ad.zip
subwindows now working in 6.2, cleaned some code and docs
svn changeset:9246/svn branch:6.2
Diffstat (limited to 'src/com')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VView.java36
1 files changed, 19 insertions, 17 deletions
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<VWindow> removedSubWindows = new HashSet<VWindow>(
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 += "<IMG src=\"" + parsedUri + "\" />";
+ html += "<img src=\"" + parsedUri + "\" />";
}
if (notification.hasAttribute("caption")) {
- html += "<H1>"
+ html += "<h1>"
+ notification.getStringAttribute("caption")
- + "</H1>";
+ + "</h1>";
}
if (notification.hasAttribute("message")) {
html += "<p>"
@@ -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<VWindow> rem = removedSubWindows.iterator(); rem
.hasNext();) {
final VWindow w = rem.next();