]> source.dussan.org Git - vaadin-framework.git/commitdiff
Temporary fix to make AbstractOrderedLayout work again
authorArtur Signell <artur@vaadin.com>
Mon, 12 Mar 2012 10:13:16 +0000 (12:13 +0200)
committerArtur Signell <artur@vaadin.com>
Wed, 14 Mar 2012 14:00:19 +0000 (16:00 +0200)
src/com/vaadin/terminal/gwt/client/ui/AbstractOrderedLayoutConnector.java

index aec7f5cd3ce7a3de5f08c5a273e1ee34655d1b6c..c49b55eef71bd451ef4ba84d0d4cca67b7a95f1c 100644 (file)
@@ -3,8 +3,8 @@
  */
 package com.vaadin.terminal.gwt.client.ui;
 
-import java.util.HashSet;
 import java.util.Iterator;
+import java.util.List;
 
 import com.google.gwt.dom.client.Node;
 import com.google.gwt.dom.client.Style;
@@ -24,6 +24,8 @@ import com.vaadin.terminal.gwt.client.ui.layout.VLayoutSlot;
 public abstract class AbstractOrderedLayoutConnector extends
         AbstractComponentContainerConnector implements DirectionalManagedLayout {
 
+    private List<ComponentConnector> previousChildren;
+
     @Override
     public void init() {
         getLayoutManager().registerDependency(this,
@@ -62,9 +64,6 @@ public abstract class AbstractOrderedLayoutConnector extends
             return;
         }
 
-        HashSet<ComponentConnector> previousChildren = new HashSet<ComponentConnector>(
-                getChildren());
-
         VMeasuringOrderedLayout layout = getWidget();
 
         ValueMap expandRatios = uidl.getMapAttribute("expandRatios");
@@ -72,6 +71,7 @@ public abstract class AbstractOrderedLayoutConnector extends
 
         int currentIndex = 0;
         // TODO Support reordering elements!
+        // FIXME: move to connectorHierarchyChanged!!
         for (final Iterator<Object> it = uidl.getChildIterator(); it.hasNext();) {
             final UIDL childUIDL = (UIDL) it.next();
             final ComponentConnector child = client.getPaintable(childUIDL);
@@ -281,4 +281,10 @@ public abstract class AbstractOrderedLayoutConnector extends
         }
     }
 
+    @Override
+    public void connectorHierarchyChanged(
+            com.vaadin.terminal.gwt.client.ConnectorHierarchyChangedEvent event) {
+        previousChildren = event.getOldChildren();
+    };
+
 }