From: Artur Signell Date: Thu, 13 Nov 2008 14:28:02 +0000 (+0000) Subject: Container is no longer responsible for unregistering paintable in replaceChildCompone... X-Git-Tag: 6.7.0.beta1~3804 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c9e2fa131c049387580f42c3dda535d90713e4bc;p=vaadin-framework.git Container is no longer responsible for unregistering paintable in replaceChildComponent (#2204) svn changeset:5890/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java index da76420ae0..01e7b01e6b 100755 --- a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java @@ -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() + "%"); diff --git a/src/com/itmill/toolkit/terminal/gwt/client/Container.java b/src/com/itmill/toolkit/terminal/gwt/client/Container.java index 7d67c2f082..e3fc7c95a9 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/Container.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/Container.java @@ -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