From b47a7d5cdeb51cd7c536d2cfe4ce17b06954d51c Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 12 Mar 2012 12:13:16 +0200 Subject: [PATCH] Temporary fix to make AbstractOrderedLayout work again --- .../client/ui/AbstractOrderedLayoutConnector.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractOrderedLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractOrderedLayoutConnector.java index aec7f5cd3c..c49b55eef7 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractOrderedLayoutConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractOrderedLayoutConnector.java @@ -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 previousChildren; + @Override public void init() { getLayoutManager().registerDependency(this, @@ -62,9 +64,6 @@ public abstract class AbstractOrderedLayoutConnector extends return; } - HashSet previousChildren = new HashSet( - 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 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(); + }; + } -- 2.39.5