]> source.dussan.org Git - vaadin-framework.git/commitdiff
Make container instead of child depend on child caption (#8313)
authorLeif Åstrand <leif@vaadin.com>
Tue, 7 Feb 2012 13:07:09 +0000 (15:07 +0200)
committerLeif Åstrand <leif@vaadin.com>
Tue, 7 Feb 2012 13:07:09 +0000 (15:07 +0200)
src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java

index f1838cf30e19a8e54635225c102c33d3d85fb444..c13ebc87f3202cbb704578bd8bbbe5169d6cfa03 100644 (file)
@@ -31,10 +31,7 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
                 getWidgetForPaintable().addCaption(caption, widget);
                 getWidgetForPaintable().captions.put(component, caption);
 
-                MeasureManager.MeasuredSize measuredSize = component
-                        .getMeasuredSize();
-
-                measuredSize.registerDependency(caption.getElement());
+                getMeasuredSize().registerDependency(caption.getElement());
             }
             caption.updateCaption(uidl);
         } else {
@@ -42,9 +39,8 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
                     .remove(component);
             if (removedCaption != null) {
                 getWidgetForPaintable().remove(removedCaption);
-                MeasureManager.MeasuredSize measuredSize = component
-                        .getMeasuredSize();
-                measuredSize.deRegisterDependency(removedCaption.getElement());
+                getMeasuredSize().deRegisterDependency(
+                        removedCaption.getElement());
             }
         }
     }
@@ -121,18 +117,15 @@ public abstract class VMeasuringOrderedLayoutPaintable extends
         if (caption == null) {
             return 0;
         } else {
-            MeasureManager.MeasuredSize measuredSize = child.getMeasuredSize();
-            return measuredSize.getDependencyWidth(caption.getElement());
+            return getMeasuredSize().getDependencyWidth(caption.getElement());
         }
     }
 
     private int getCaptionHeight(VPaintableWidget child) {
-
         VCaption caption = getWidgetForPaintable().captions.get(child);
         if (caption != null) {
-            MeasureManager.MeasuredSize measuredSize = child.getMeasuredSize();
-            int captionHeight = measuredSize.getDependencyHeight(caption
-                    .getElement());
+            int captionHeight = getMeasuredSize().getDependencyHeight(
+                    caption.getElement());
 
             caption.getElement().getStyle()
                     .setMarginTop(-captionHeight, Unit.PX);