diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-02-10 14:14:22 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-02-10 14:14:22 +0200 |
commit | ecd80181d160b58a281eb92fabaa2a10ea0adac2 (patch) | |
tree | 4af90e659e99f1e91a98317e323d7edf5570da10 /src | |
parent | 503e7760fa0764fcc822d83d202a61e1c93dff6b (diff) | |
download | vaadin-framework-ecd80181d160b58a281eb92fabaa2a10ea0adac2.tar.gz vaadin-framework-ecd80181d160b58a281eb92fabaa2a10ea0adac2.zip |
Also find paintables inside HasOneWidget widgets (#8323)
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidgetContainer.java | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidgetContainer.java b/src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidgetContainer.java index ebdb05a6c8..42addc66eb 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidgetContainer.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VAbstractPaintableWidgetContainer.java @@ -6,6 +6,7 @@ package com.vaadin.terminal.gwt.client.ui; import java.util.ArrayList; import java.util.Collection; +import com.google.gwt.user.client.ui.HasOneWidget; import com.google.gwt.user.client.ui.HasWidgets; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.VPaintableMap; @@ -36,15 +37,23 @@ public abstract class VAbstractPaintableWidgetContainer extends if (widget instanceof HasWidgets) { for (Widget child : (HasWidgets) widget) { - VPaintableWidget paintable = paintableMap.getPaintable(child); - if (paintable != null) { - // If child is a paintable, add it to the collection - paintables.add(paintable); - } else { - // Else keep looking for paintables inside the child widget - addDescendantPaintables(child, paintables, paintableMap); - } + addIfPaintable(child, paintables, paintableMap); } + } else if (widget instanceof HasOneWidget) { + Widget child = ((HasOneWidget) widget).getWidget(); + addIfPaintable(child, paintables, paintableMap); + } + } + + private static void addIfPaintable(Widget widget, + Collection<VPaintableWidget> paintables, VPaintableMap paintableMap) { + VPaintableWidget paintable = paintableMap.getPaintable(widget); + if (paintable != null) { + // If widget is a paintable, add it to the collection + paintables.add(paintable); + } else { + // Else keep looking for paintables inside the widget + addDescendantPaintables(widget, paintables, paintableMap); } } |