summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2012-10-29 15:43:31 +0200
committerVaadin Code Review <review@vaadin.com>2012-10-30 09:47:47 +0000
commit2364f3ec9fca600a5e926040ad3653de84bfed7d (patch)
treeb2b4179704714c2428ad201bde1cfa2945f70369 /server/src/com/vaadin
parentf75f47f2f275d03791677244e11646409099d41d (diff)
downloadvaadin-framework-2364f3ec9fca600a5e926040ad3653de84bfed7d.tar.gz
vaadin-framework-2364f3ec9fca600a5e926040ad3653de84bfed7d.zip
Move deprecated getComponentIterator() from HasComponents to implementing classes (#10085)
Change-Id: Iedcb7b51f6d2a095b402a7141dc906b112ee6fe7
Diffstat (limited to 'server/src/com/vaadin')
-rw-r--r--server/src/com/vaadin/ui/ComponentContainer.java13
-rw-r--r--server/src/com/vaadin/ui/CustomField.java9
-rw-r--r--server/src/com/vaadin/ui/Form.java9
-rw-r--r--server/src/com/vaadin/ui/HasComponents.java6
-rw-r--r--server/src/com/vaadin/ui/Table.java14
5 files changed, 35 insertions, 16 deletions
diff --git a/server/src/com/vaadin/ui/ComponentContainer.java b/server/src/com/vaadin/ui/ComponentContainer.java
index 50a6e7e148..3663134520 100644
--- a/server/src/com/vaadin/ui/ComponentContainer.java
+++ b/server/src/com/vaadin/ui/ComponentContainer.java
@@ -17,6 +17,7 @@
package com.vaadin.ui;
import java.io.Serializable;
+import java.util.Iterator;
/**
* Extension to the {@link Component} interface which adds to it the capacity to
@@ -70,6 +71,18 @@ public interface ComponentContainer extends HasComponents {
public void replaceComponent(Component oldComponent, Component newComponent);
/**
+ * Gets an iterator to the collection of contained components. Using this
+ * iterator it is possible to step through all components contained in this
+ * container.
+ *
+ * @return the component iterator.
+ *
+ * @deprecated As of 7.0, use {@link #iterator()} instead.
+ */
+ @Deprecated
+ public Iterator<Component> getComponentIterator();
+
+ /**
* Gets the number of children this {@link ComponentContainer} has. This
* must be symmetric with what {@link #getComponentIterator()} returns.
*
diff --git a/server/src/com/vaadin/ui/CustomField.java b/server/src/com/vaadin/ui/CustomField.java
index e782bd1783..67695fe54b 100644
--- a/server/src/com/vaadin/ui/CustomField.java
+++ b/server/src/com/vaadin/ui/CustomField.java
@@ -146,14 +146,17 @@ public abstract class CustomField<T> extends AbstractField<T> implements
}
}
- @Override
+ /**
+ * @deprecated As of 7.0, use {@link #iterator()} instead.
+ */
+ @Deprecated
public Iterator<Component> getComponentIterator() {
- return new ComponentIterator();
+ return iterator();
}
@Override
public Iterator<Component> iterator() {
- return getComponentIterator();
+ return new ComponentIterator();
}
@Override
diff --git a/server/src/com/vaadin/ui/Form.java b/server/src/com/vaadin/ui/Form.java
index 4b7782e0a9..46a335669e 100644
--- a/server/src/com/vaadin/ui/Form.java
+++ b/server/src/com/vaadin/ui/Form.java
@@ -1306,7 +1306,7 @@ public class Form extends AbstractField<Object> implements Item.Editor,
@Override
public Iterator<Component> iterator() {
- return getComponentIterator();
+ return new ComponentIterator();
}
/**
@@ -1355,9 +1355,12 @@ public class Form extends AbstractField<Object> implements Item.Editor,
}
}
- @Override
+ /**
+ * @deprecated As of 7.0, use {@link #iterator()} instead.
+ */
+ @Deprecated
public Iterator<Component> getComponentIterator() {
- return new ComponentIterator();
+ return iterator();
}
public int getComponentCount() {
diff --git a/server/src/com/vaadin/ui/HasComponents.java b/server/src/com/vaadin/ui/HasComponents.java
index 8f1dccc5c6..db0aa1ca8e 100644
--- a/server/src/com/vaadin/ui/HasComponents.java
+++ b/server/src/com/vaadin/ui/HasComponents.java
@@ -32,11 +32,9 @@ public interface HasComponents extends Component, Iterable<Component> {
* container.
*
* @return the component iterator.
- *
- * @deprecated Use {@link #iterator()} instead.
*/
- @Deprecated
- public Iterator<Component> getComponentIterator();
+ @Override
+ public Iterator<Component> iterator();
/**
* Checks if the child component is visible. This method allows hiding a
diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java
index 242593c20d..352b9212a7 100644
--- a/server/src/com/vaadin/ui/Table.java
+++ b/server/src/com/vaadin/ui/Table.java
@@ -5564,19 +5564,21 @@ public class Table extends AbstractSelect implements Action.Container,
@Override
public Iterator<Component> iterator() {
- return getComponentIterator();
- }
-
- @Override
- public Iterator<Component> getComponentIterator() {
if (visibleComponents == null) {
Collection<Component> empty = Collections.emptyList();
return empty.iterator();
}
-
return visibleComponents.iterator();
}
+ /**
+ * @deprecated As of 7.0, use {@link #iterator()} instead.
+ */
+ @Deprecated
+ public Iterator<Component> getComponentIterator() {
+ return iterator();
+ }
+
@Override
public boolean isComponentVisible(Component childComponent) {
return true;