]> source.dussan.org Git - vaadin-framework.git/commitdiff
Implemented replaceChildComponent for GridLayout
authorArtur Signell <artur.signell@itmill.com>
Mon, 10 Nov 2008 06:48:34 +0000 (06:48 +0000)
committerArtur Signell <artur.signell@itmill.com>
Mon, 10 Nov 2008 06:48:34 +0000 (06:48 +0000)
svn changeset:5835/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IGridLayout.java

index 0cadee9e73eccdb2fb39357f7ab904402737b6e5..180bc7e3f03965601f629fbd620f7aaa72656293 100644 (file)
@@ -519,7 +519,18 @@ public class IGridLayout extends SimplePanel implements Paintable, Container {
     }
 
     public void replaceChildComponent(Widget oldComponent, Widget newComponent) {
-        // TODO
+        ChildComponentContainer componentContainer = widgetToComponentContainer
+                .remove(oldComponent);
+        if (componentContainer == null) {
+            return;
+        }
+
+        componentContainer.setWidget(newComponent);
+        client.unregisterPaintable((Paintable) oldComponent);
+        widgetToComponentContainer.put(newComponent, componentContainer);
+
+        paintableToCell.put((Paintable) newComponent, paintableToCell
+                .get(oldComponent));
     }
 
     public void updateCaption(Paintable component, UIDL uidl) {