summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/vaadin/ui')
-rw-r--r--src/com/vaadin/ui/Panel.java3
-rw-r--r--src/com/vaadin/ui/Root.java14
2 files changed, 12 insertions, 5 deletions
diff --git a/src/com/vaadin/ui/Panel.java b/src/com/vaadin/ui/Panel.java
index 37e03ffb37..c339100cda 100644
--- a/src/com/vaadin/ui/Panel.java
+++ b/src/com/vaadin/ui/Panel.java
@@ -4,6 +4,7 @@
package com.vaadin.ui;
+import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
@@ -229,7 +230,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable,
* @see com.vaadin.ui.ComponentContainer#getComponentIterator()
*/
public Iterator<Component> getComponentIterator() {
- return content.getComponentIterator();
+ return Collections.singleton((Component) content).iterator();
}
/**
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);
}
/**