Package com.vaadin.classic.v8.ui
Interface SingleComponentContainer
- All Superinterfaces:
HasComponents,HasComponents.ComponentAttachDetachNotifier,Iterable<com.vaadin.flow.component.Component>,Serializable
- All Known Implementing Classes:
AbstractSingleComponentContainer,Panel
public interface SingleComponentContainer
extends HasComponents, HasComponents.ComponentAttachDetachNotifier
Interface for classic component containers that have one child component and
do not support adding or removing components.
For component containers that support multiple children, see
ComponentContainer instead.-
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 TypeMethodDescriptionintGets the number of children thisSingleComponentContainerhas.com.vaadin.flow.component.ComponentGets the content of this container.voidsetContent(com.vaadin.flow.component.Component content) Sets the content of this container.Methods inherited from interface com.vaadin.classic.v8.ui.HasComponents
iteratorMethods inherited from interface com.vaadin.classic.v8.ui.HasComponents.ComponentAttachDetachNotifier
addComponentAttachListener, addComponentDetachListenerMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getComponentCount
int getComponentCount()Gets the number of children thisSingleComponentContainerhas. This must be symmetric with whatHasComponents.iterator()returns and thus typically return 1 if the content is set, 0 otherwise.- Returns:
- The number of child components this container has.
-
getContent
com.vaadin.flow.component.Component getContent()Gets the content of this container. The content is a component that serves as the outermost item of the visual contents.- Returns:
- a component to use as content
- See Also:
-
setContent
void setContent(com.vaadin.flow.component.Component content) Sets the content of this container. The content is a component that serves as the outermost item of the visual contents. The content should always be set, either as a constructor parameter or by calling this method.
-