diff options
author | Denis Anisimov <denis@vaadin.com> | 2014-04-13 22:08:22 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-04-14 08:15:51 +0000 |
commit | ee203f581aead7b234a4b64db9a6006e2887dc47 (patch) | |
tree | 170d36acf1964f119fc6e7226ae4f3d8b0b64601 /server/src | |
parent | 02998d815a989ec13e1a49372c2c010233f6bfb9 (diff) | |
download | vaadin-framework-ee203f581aead7b234a4b64db9a6006e2887dc47.tar.gz vaadin-framework-ee203f581aead7b234a4b64db9a6006e2887dc47.zip |
Apply abstract ordered layout settings for replaced component (#13568).
Change-Id: If6863d518d902ee48bb73fbb0c9b3725cb7c8707
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/com/vaadin/ui/AbstractOrderedLayout.java | 10 |
1 files changed, 10 insertions, 0 deletions
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); + } + } |