]> source.dussan.org Git - vaadin-framework.git/commitdiff
Container is no longer responsible for unregistering paintable in replaceChildCompone...
authorArtur Signell <artur.signell@itmill.com>
Thu, 13 Nov 2008 14:28:02 +0000 (14:28 +0000)
committerArtur Signell <artur.signell@itmill.com>
Thu, 13 Nov 2008 14:28:02 +0000 (14:28 +0000)
svn changeset:5890/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java
src/com/itmill/toolkit/terminal/gwt/client/Container.java

index da76420ae03196cedc5c27731e6ea49fbb309879..01e7b01e6b218c2559d1e0ba02b48edb45a49ee2 100755 (executable)
@@ -935,6 +935,7 @@ public class ApplicationConnection {
             if (parent != null) {
                 final Widget w = (Widget) widgetSet.createWidget(uidl);
                 parent.replaceChildComponent(component, w);
+                unregisterPaintable((Paintable) component);
                 registerPaintable(uidl.getId(), (Paintable) w);
                 ((Paintable) w).updateFromUIDL(uidl, this);
                 return true;
@@ -1078,10 +1079,7 @@ public class ApplicationConnection {
      */
     public void runDescendentsLayout(HasWidgets container) {
         // getConsole().log(
-        // "runDescendentsLayout("
-        // + container.getClass().getName().replaceAll(
-        // "[^\\.]*\\.", "") + "/" + container.hashCode()
-        // + ")");
+        // "runDescendentsLayout(" + Util.getSimpleName(container) + ")");
         final Iterator childWidgets = container.iterator();
         while (childWidgets.hasNext()) {
             final Widget child = (Widget) childWidgets.next();
@@ -1161,13 +1159,15 @@ public class ApplicationConnection {
                 if (height < 0) {
                     height = 0;
                 }
+
                 // getConsole().log(
-                // "Widget " + widget.getClass().getName() + "/"
+                // "Widget " + Util.getSimpleName(widget) + "/"
                 // + widget.hashCode() + " relative height "
                 // + relativeSize.getHeight() + "% of "
-                // + renderSpace.getHeight() + "px ("
-                // + renderSpace.getReservedHeight()
-                // + "px reserved): " + height + "px");
+                // + renderSpace.getHeight() + "px (reported by "
+                //
+                // + Util.getSimpleName(parent) + "/"
+                // + parent.hashCode() + ") : " + height + "px");
                 widget.setHeight(height + "px");
             } else {
                 widget.setHeight(relativeSize.getHeight() + "%");
@@ -1205,12 +1205,12 @@ public class ApplicationConnection {
                 }
 
                 // getConsole().log(
-                // "Widget " + widget.getClass().getName() + "/"
+                // "Widget " + Util.getSimpleName(widget) + "/"
                 // + widget.hashCode() + " relative width "
                 // + relativeSize.getWidth() + "% of "
-                // + renderSpace.getWidth() + "px ("
-                // + renderSpace.getReservedWidth()
-                // + "px reserved): " + width + "px");
+                // + renderSpace.getWidth() + "px (reported by "
+                // + Util.getSimpleName(parent) + "/"
+                // + parent.hashCode() + ") : " + width + "px");
                 widget.setWidth(width + "px");
             } else {
                 widget.setWidth(relativeSize.getWidth() + "%");
index 7d67c2f082ed409d0e34b8ac7fd49ef83a4c7bae..e3fc7c95a9aa1ac1cb362b0ae76f01eaf0bfb210 100644 (file)
@@ -14,9 +14,7 @@ public interface Container extends Paintable {
      * Replace child of this layout with another component.
      * 
      * Each layout must be able to switch children. To to this, one must just
-     * give references to a current and new child. Note that the Layout is not
-     * responsible for registering Paintable into ApplicationConnection, but it
-     * is responsible is for unregistering it.
+     * give references to a current and new child.
      * 
      * @param oldComponent
      *            Child to be replaced