Package com.vaadin.classic.v8.ui
Interface ComponentContainer
- All Superinterfaces:
HasComponents,com.vaadin.flow.component.HasComponents,HasComponents.ComponentAttachDetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,Iterable<com.vaadin.flow.component.Component>,Serializable
- All Known Subinterfaces:
Layout
- All Known Implementing Classes:
AbsoluteLayout,AbstractComponentContainer,AbstractLayout,AbstractOrderedLayout,FormLayout,GridLayout,HorizontalLayout,VerticalLayout
public interface ComponentContainer
extends HasComponents, com.vaadin.flow.component.HasComponents, HasComponents.ComponentAttachDetachNotifier
Legacy version of ComponentContainer, 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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.classic.v8.ui.HasComponents
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(com.vaadin.flow.component.Component c) Adds the component into this container.voidaddComponents(com.vaadin.flow.component.Component... components) Adds the components in the given order to this component container.intGets the number of children thisComponentContainerhasvoidmoveComponentsFrom(ComponentContainer source) Moves all components from another container into this container.voidRemoves all components from this container.voidremoveComponent(com.vaadin.flow.component.Component c) Removes the component from this container.voidreplaceComponent(com.vaadin.flow.component.Component oldComponent, com.vaadin.flow.component.Component newComponent) Replaces the component in the container with another one without changing position.Methods inherited from interface com.vaadin.classic.v8.ui.HasComponents
iteratorMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAllMethods inherited from interface com.vaadin.classic.v8.ui.HasComponents.ComponentAttachDetachNotifier
addComponentAttachListener, addComponentDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
addComponent
void addComponent(com.vaadin.flow.component.Component c) Adds the component into this container.- Parameters:
c- the component to be added.
-
addComponents
void addComponents(com.vaadin.flow.component.Component... components) Adds the components in the given order to this component container.- Parameters:
components- The components to add.
-
removeComponent
void removeComponent(com.vaadin.flow.component.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(com.vaadin.flow.component.Component oldComponent, com.vaadin.flow.component.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.
-
getComponentCount
int getComponentCount()Gets the number of children thisComponentContainerhas- Returns:
- The number of child components this container has.
-
moveComponentsFrom
Moves all components from another container into this container. The components are removed fromsource.- Parameters:
source- the container which contains the components that are to be moved to this container.
-