Interface ComponentContainer

All Known Implementing Classes:
DynamicAttributesPanel, JmixAccordion, JmixAccordionPanel, JmixAppLayout, JmixDetails, JmixFormLayout, JmixScroller, JmixSplitLayout, JmixTabs, JmixTabSheet, MainTabSheet, ViewLayout, WorkArea

public interface ComponentContainer
An interface for component containers that provides methods for managing and interacting with child components within a container. It defines utility methods to find, retrieve, and list components based on their identifiers or their hierarchical relationship with the container.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Optional<com.vaadin.flow.component.Component>
    Finds a component within the container hierarchy by its unique identifier.
    Optional<com.vaadin.flow.component.Component>
    Finds a component within immediate children of the container by its unique identifier.
    default com.vaadin.flow.component.Component
    Returns a child component from the container hierarchy by its unique identifier.
    default Collection<com.vaadin.flow.component.Component>
    Returns a collection of all components within the container hierarchy.
    default com.vaadin.flow.component.Component
    Returns a child component from the immediate children of the container by its unique identifier.
    Collection<com.vaadin.flow.component.Component>
    Returns a collection of components that are direct children (immediate descendants) of the container.
  • Method Details

    • findComponent

      default Optional<com.vaadin.flow.component.Component> findComponent(String id)
      Finds a component within the container hierarchy by its unique identifier.
      Parameters:
      id - the unique identifier of the component to find
      Returns:
      an Optional containing the found component if it exists, or an empty Optional if no component with the given identifier is found
    • getComponent

      default com.vaadin.flow.component.Component getComponent(String id)
      Returns a child component from the container hierarchy by its unique identifier. If the component is not found, an IllegalArgumentException is thrown.
      Parameters:
      id - the unique identifier of the component to retrieve
      Returns:
      the Component instance associated with the specified identifier
      Throws:
      IllegalArgumentException - if no component with the given identifier is found
    • findOwnComponent

      Optional<com.vaadin.flow.component.Component> findOwnComponent(String id)
      Finds a component within immediate children of the container by its unique identifier.
      Parameters:
      id - the unique identifier of the component to find
      Returns:
      an Optional containing the found component if it exists within the immediate children of the container, or an empty Optional if no component with the given identifier is found
    • getOwnComponent

      default com.vaadin.flow.component.Component getOwnComponent(String id)
      Returns a child component from the immediate children of the container by its unique identifier. If the component is not found, an IllegalArgumentException is thrown.
      Parameters:
      id - the unique identifier of the component to retrieve
      Returns:
      the Component instance associated with the specified identifier
      Throws:
      IllegalArgumentException - if no component with the given identifier is found
    • getOwnComponents

      Collection<com.vaadin.flow.component.Component> getOwnComponents()
      Returns a collection of components that are direct children (immediate descendants) of the container.
      Returns:
      a collection of Component instances representing the immediate children of the container, or an empty collection if no such components exist
    • getComponents

      default Collection<com.vaadin.flow.component.Component> getComponents()
      Returns a collection of all components within the container hierarchy.
      Returns:
      a collection of Component instances representing all components within the container hierarchy, or an empty collection if no components exist