diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-02-07 13:48:36 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-02-07 13:48:36 +0200 |
commit | 27e820a5f4cdc944b6d3e82d25509fd453489062 (patch) | |
tree | 70a9bc08f582cf4fb381fd173507b52d0c94d5ff /src/com/vaadin | |
parent | b376255c55d3bec1d47cb565e88f1c1e46827c0e (diff) | |
download | vaadin-framework-27e820a5f4cdc944b6d3e82d25509fd453489062.tar.gz vaadin-framework-27e820a5f4cdc944b6d3e82d25509fd453489062.zip |
Use VPaintableWidgetContainer.getChildren() instead of static helper
Diffstat (limited to 'src/com/vaadin')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/MeasureManager.java | 29 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java | 6 |
2 files changed, 2 insertions, 33 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/MeasureManager.java b/src/com/vaadin/terminal/gwt/client/MeasureManager.java index 9bcecfd786..6fbaa3b3f7 100644 --- a/src/com/vaadin/terminal/gwt/client/MeasureManager.java +++ b/src/com/vaadin/terminal/gwt/client/MeasureManager.java @@ -1,14 +1,11 @@ package com.vaadin.terminal.gwt.client; -import java.util.ArrayList; -import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import com.google.gwt.core.client.JsArrayString; import com.google.gwt.dom.client.Element; -import com.google.gwt.user.client.ui.HasWidgets; import com.google.gwt.user.client.ui.RequiresResize; import com.google.gwt.user.client.ui.Widget; @@ -82,32 +79,6 @@ public class MeasureManager { private static MeasureManager instance = new MeasureManager(); - public static Collection<VPaintableWidget> getChildren( - VPaintableWidgetContainer paintable, ApplicationConnection client) { - Widget widget = paintable.getWidgetForPaintable(); - Collection<VPaintableWidget> children = new ArrayList<VPaintableWidget>(); - - addDescendantPaintables(widget, children, client); - - return children; - } - - private static void addDescendantPaintables(Widget widget, - Collection<VPaintableWidget> paintables, - ApplicationConnection client) { - if (widget instanceof HasWidgets) { - VPaintableMap paintableMap = client.getPaintableMap(); - for (Widget child : (HasWidgets) widget) { - VPaintableWidget paintable = paintableMap.getPaintable(child); - if (paintable != null) { - paintables.add(paintable); - } else { - addDescendantPaintables(child, paintables, client); - } - } - } - } - public void doLayout(ApplicationConnection client) { VPaintableMap paintableMap = client.getPaintableMap(); VPaintableWidget[] paintableWidgets = paintableMap diff --git a/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java b/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java index d67574e90f..5e0565f539 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VMeasuringOrderedLayoutPaintable.java @@ -215,8 +215,7 @@ public abstract class VMeasuringOrderedLayoutPaintable extends } private void layoutPrimaryDirection() { - Collection<VPaintableWidget> children = MeasureManager.getChildren( - this, getWidgetForPaintable().client); + Collection<VPaintableWidget> children = getChildren(); // First pass - get total expand ratio and allocated size int totalAllocated = 0; @@ -335,8 +334,7 @@ public abstract class VMeasuringOrderedLayoutPaintable extends } private void layoutSecondaryDirection() { - Collection<VPaintableWidget> children = MeasureManager.getChildren( - this, getWidgetForPaintable().client); + Collection<VPaintableWidget> children = getChildren(); int maxSize = 0; for (VPaintableWidget child : children) { |