From: Marc Englund Date: Mon, 5 Nov 2007 15:28:11 +0000 (+0000) Subject: Renders Notifications. X-Git-Tag: 6.7.0.beta1~5667 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bf4817c10409082c01bf59f20568d9e628c9d5ba;p=vaadin-framework.git Renders Notifications. svn changeset:2713/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java index 3217d6f2d4..30fe2a3d4e 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IView.java @@ -28,7 +28,7 @@ public class IView extends SimplePanel implements Paintable, private Paintable layout; - private HashSet subWindows = new HashSet(); + private final HashSet subWindows = new HashSet(); private String id; @@ -73,7 +73,7 @@ public class IView extends SimplePanel implements Paintable, // Draw this application level window UIDL childUidl = uidl.getChildUIDL(childIndex); Paintable lo = (Paintable) client.getWidget(childUidl); - + if (layout != null) { if (layout != lo) { // remove old @@ -106,6 +106,28 @@ public class IView extends SimplePanel implements Paintable, actionHandler = new ShortcutActionHandler(id, client); } actionHandler.updateActionMap(childUidl); + } else if (childUidl.getTag().equals("notifications")) { + for (Iterator it = childUidl.getChildIterator(); it.hasNext();) { + UIDL notification = (UIDL) it.next(); + String html = ""; + if (notification.hasAttribute("caption")) { + html += "

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

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

" + + notification.getStringAttribute("message") + + "

"; + } + + String style = notification.hasAttribute("style") ? notification + .getStringAttribute("style") + : null; + int position = notification.getIntAttribute("position"); + int delay = notification.getIntAttribute("delay"); + new Notification(delay).show(html, position, style); + } } }