From ee203f581aead7b234a4b64db9a6006e2887dc47 Mon Sep 17 00:00:00 2001 From: Denis Anisimov Date: Sun, 13 Apr 2014 22:08:22 +0300 Subject: Apply abstract ordered layout settings for replaced component (#13568). Change-Id: If6863d518d902ee48bb73fbb0c9b3725cb7c8707 --- server/src/com/vaadin/ui/AbstractOrderedLayout.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'server/src/com/vaadin/ui') diff --git a/server/src/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/com/vaadin/ui/AbstractOrderedLayout.java index c9eb756daa..f5fd4d7bfc 100644 --- a/server/src/com/vaadin/ui/AbstractOrderedLayout.java +++ b/server/src/com/vaadin/ui/AbstractOrderedLayout.java @@ -213,8 +213,12 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements if (oldLocation == -1) { addComponent(newComponent); } else if (newLocation == -1) { + Alignment alignment = getComponentAlignment(oldComponent); + float expandRatio = getExpandRatio(oldComponent); + removeComponent(oldComponent); addComponent(newComponent, oldLocation); + applyLayoutSettings(newComponent, alignment, expandRatio); } else { // Both old and new are in the layout if (oldLocation > newLocation) { @@ -444,4 +448,10 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements defaultComponentAlignment = defaultAlignment; } + private void applyLayoutSettings(Component target, Alignment alignment, + float expandRatio) { + setComponentAlignment(target, alignment); + setExpandRatio(target, expandRatio); + } + } -- cgit v1.2.3