diff options
author | Artur Signell <artur@vaadin.com> | 2012-11-22 12:29:49 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-11-22 12:29:49 +0200 |
commit | c19b1fee143f8dfeb681ba5c58d582c607ee48a6 (patch) | |
tree | 4be155f26ed7cab8ebc5401cf3610e1b023dc86a /server | |
parent | 7fb247173e34e445e13fcec76b30246be8799791 (diff) | |
download | vaadin-framework-c19b1fee143f8dfeb681ba5c58d582c607ee48a6.tar.gz vaadin-framework-c19b1fee143f8dfeb681ba5c58d582c607ee48a6.zip |
Added ComponentContainer.addComponents (#10245)
Change-Id: Ie859d194456466424c55ef5e1c2a330f0172e5de
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/ui/AbstractComponentContainer.java | 13 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/AbstractOrderedLayout.java | 12 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/ComponentContainer.java | 14 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/CssLayout.java | 13 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/GridLayout.java | 13 |
5 files changed, 24 insertions, 41 deletions
diff --git a/server/src/com/vaadin/ui/AbstractComponentContainer.java b/server/src/com/vaadin/ui/AbstractComponentContainer.java index b5cc3da861..135194f12c 100644 --- a/server/src/com/vaadin/ui/AbstractComponentContainer.java +++ b/server/src/com/vaadin/ui/AbstractComponentContainer.java @@ -43,6 +43,19 @@ public abstract class AbstractComponentContainer extends AbstractComponent super(); } + /* + * (non-Javadoc) + * + * @see + * com.vaadin.ui.ComponentContainer#addComponents(com.vaadin.ui.Component[]) + */ + @Override + public void addComponents(Component... components) { + for (Component c : components) { + addComponent(c); + } + } + /** * Removes all components from the container. This should probably be * re-implemented in extending classes for a more powerful implementation. diff --git a/server/src/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/com/vaadin/ui/AbstractOrderedLayout.java index 729862a93e..5f5768a237 100644 --- a/server/src/com/vaadin/ui/AbstractOrderedLayout.java +++ b/server/src/com/vaadin/ui/AbstractOrderedLayout.java @@ -113,18 +113,6 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements } /** - * Adds the given components in the given order to the container. - * - * @param components - * The components to add. - */ - public void addComponents(Component... components) { - for (Component c : components) { - addComponent(c); - } - } - - /** * Adds a component into indexed position in this container. * * @param c diff --git a/server/src/com/vaadin/ui/ComponentContainer.java b/server/src/com/vaadin/ui/ComponentContainer.java index 5ef41d7cbf..5c544ceffb 100644 --- a/server/src/com/vaadin/ui/ComponentContainer.java +++ b/server/src/com/vaadin/ui/ComponentContainer.java @@ -21,9 +21,9 @@ import java.util.Iterator; import com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier; /** - * Extension to the {@link Component} interface which adds to it the capacity to - * contain other components. All UI elements that can have child elements - * implement this interface. + * A special type of parent which allows the user to add and remove components + * to it. Typically does not have any restrictions on the number of children it + * can contain. * * @author Vaadin Ltd. * @since 3.0 @@ -40,6 +40,14 @@ public interface ComponentContainer extends HasComponents, public void addComponent(Component c); /** + * Adds the components in the given order to this component container. + * + * @param components + * The components to add. + */ + public void addComponents(Component... components); + + /** * Removes the component from this container. * * @param c diff --git a/server/src/com/vaadin/ui/CssLayout.java b/server/src/com/vaadin/ui/CssLayout.java index aa072df946..228624769f 100644 --- a/server/src/com/vaadin/ui/CssLayout.java +++ b/server/src/com/vaadin/ui/CssLayout.java @@ -126,19 +126,6 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { } /** - * Adds the given components into this container. Each component is added to - * the right or below the previous component. - * - * @param components - * The components to add. - */ - public void addComponents(Component... components) { - for (Component c : components) { - addComponent(c); - } - } - - /** * Adds a component into this container. The component is added to the left * or on top of the other components. * diff --git a/server/src/com/vaadin/ui/GridLayout.java b/server/src/com/vaadin/ui/GridLayout.java index 8fda05baf1..2504592058 100644 --- a/server/src/com/vaadin/ui/GridLayout.java +++ b/server/src/com/vaadin/ui/GridLayout.java @@ -275,19 +275,6 @@ public class GridLayout extends AbstractLayout implements } /** - * Adds the given components to the grid starting from the current cursor - * position. - * - * @param components - * Components to add. - */ - public void addComponents(Component... components) { - for (Component c : components) { - this.addComponent(c); - } - } - - /** * Tests if the given area overlaps with any of the items already on the * grid. * |