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.
  • Method Details

    • getComponentCount

      int getComponentCount()
      Gets the number of children this SingleComponentContainer has. This must be symmetric with what HasComponents.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.