com.vaadin.ui.

Interface ComponentContainer

    • Method Detail

      • addComponent

        void addComponent​(Component c)

        Adds the component into this container.

        Parameters:

        c - the component to be added.

      • addComponents

        void addComponents​(Component... components)

        Adds the components in the given order to this component container.

        Parameters:

        components - The components to add.

      • removeComponent

        void removeComponent​(Component c)

        Removes the component from this container.

        Parameters:

        c - the component to be removed.

      • removeAllComponents

        void removeAllComponents()

        Removes all components from this container.

      • replaceComponent

        void replaceComponent​(Component oldComponent,
                              Component newComponent)

        Replaces the component in the container with another one without changing position.

        This method replaces component with another one is such way that the new component overtakes the position of the old component. If the old component is not in the container, the new component is added to the container. If the both component are already in the container, their positions are swapped. Component attach and detach events should be taken care as with add and remove.

        Parameters:

        oldComponent - the old component that will be replaced.

        newComponent - the new component to be replaced.

      • getComponentIterator

        @Deprecated
        Iterator<Component> getComponentIterator()
        Deprecated.
        As of 7.0, use HasComponents.iterator() instead.

        Gets an iterator to the collection of contained components. Using this iterator it is possible to step through all components contained in this container.

        Returns:

        the component iterator.

      • getComponentCount

        int getComponentCount()

        Gets the number of children this ComponentContainer has. This must be symmetric with what getComponentIterator() returns.

        Returns:

        The number of child components this container has.

        Since:

        7.0.0

      • moveComponentsFrom

        void moveComponentsFrom​(ComponentContainer source)

        Moves all components from an another container into this container. The components are removed from source.

        Parameters:

        source - the container which contains the components that are to be moved to this container.