summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui/Root.java
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-05-29 14:23:39 +0300
committerLeif Åstrand <leif@vaadin.com>2012-06-06 09:33:10 +0300
commitf77f121d0dd47ffc23c8f07e034fd6a115d0c2b0 (patch)
treeb73a1792dba68aef39d197b19fbeeb4fd649c7a3 /src/com/vaadin/ui/Root.java
parent2e2020cb9b3a3f3353d7a56de7b1e0ab2b5186e1 (diff)
downloadvaadin-framework-f77f121d0dd47ffc23c8f07e034fd6a115d0c2b0.tar.gz
vaadin-framework-f77f121d0dd47ffc23c8f07e034fd6a115d0c2b0.zip
Fix some broken hierarchies (#6690)
Diffstat (limited to 'src/com/vaadin/ui/Root.java')
-rw-r--r--src/com/vaadin/ui/Root.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/vaadin/ui/Root.java b/src/com/vaadin/ui/Root.java
index 0ba8ef27fb..8792bf1912 100644
--- a/src/com/vaadin/ui/Root.java
+++ b/src/com/vaadin/ui/Root.java
@@ -643,11 +643,17 @@ public abstract class Root extends AbstractComponentContainer implements
* @see com.vaadin.ui.ComponentContainer#getComponentIterator()
*/
public Iterator<Component> getComponentIterator() {
- if (getContent() == null) {
- return Collections.EMPTY_LIST.iterator();
+ // TODO could directly create some kind of combined iterator instead of
+ // creating a new ArrayList
+ ArrayList<Component> components = new ArrayList<Component>();
+
+ if (getContent() != null) {
+ components.add(getContent());
}
- return Collections.singleton((Component) getContent()).iterator();
+ components.addAll(windows);
+
+ return components.iterator();
}
/*
@@ -656,7 +662,7 @@ public abstract class Root extends AbstractComponentContainer implements
* @see com.vaadin.ui.ComponentContainer#getComponentCount()
*/
public int getComponentCount() {
- return getContent() == null ? 0 : 1;
+ return windows.size() + (getContent() == null ? 0 : 1);
}
/**