Package io.jmix.flowui.component
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 TypeMethodDescriptiondefault Optional<com.vaadin.flow.component.Component>findComponent(String id) 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.ComponentgetComponent(String id) 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.ComponentReturns 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
Finds a component within the container hierarchy by its unique identifier. -
getComponent
Returns a child component from the container hierarchy by its unique identifier. If the component is not found, anIllegalArgumentExceptionis thrown.- Parameters:
id- the unique identifier of the component to retrieve- Returns:
- the
Componentinstance associated with the specified identifier - Throws:
IllegalArgumentException- if no component with the given identifier is found
-
findOwnComponent
Finds a component within immediate children of the container by its unique identifier. -
getOwnComponent
Returns a child component from the immediate children of the container by its unique identifier. If the component is not found, anIllegalArgumentExceptionis thrown.- Parameters:
id- the unique identifier of the component to retrieve- Returns:
- the
Componentinstance 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
Componentinstances representing the immediate children of the container, or an empty collection if no such components exist
-
getComponents
Returns a collection of all components within the container hierarchy.- Returns:
- a collection of
Componentinstances representing all components within the container hierarchy, or an empty collection if no components exist
-