com.vaadin.flow.component.shared.
Class SlotUtils
- java.lang.Object
-
- com.vaadin.flow.component.shared.SlotUtils
-
public class SlotUtils extends Object
Util methods for handling child elements inside slots.
Author:
Vaadin Ltd
-
-
Constructor Summary
Constructors Constructor Description SlotUtils()
-
Method Summary
All Methods Modifier and Type Method Description static void
clearSlot(HasElement parent, String slot)
Removes every child element of the parent that are in the specified slot.
static Component
getChildInSlot(HasElement parent, String slot)
Gets the first child component of the parent that is in the specified slot.
static Stream<Element>
getElementsInSlot(HasElement parent, String slot)
Gets all the child elements of the parent that are in the specified slot.
-
-
-
Method Detail
-
getElementsInSlot
public static Stream<Element> getElementsInSlot(HasElement parent, String slot)
Gets all the child elements of the parent that are in the specified slot.
Parameters:
parent
- the component to get children from, notnull
slot
- the name of the slot inside the parent, notnull
Returns:
the child elements of the parent that are inside the slot
-
clearSlot
public static void clearSlot(HasElement parent, String slot)
Removes every child element of the parent that are in the specified slot.
Parameters:
parent
- the component whose slot to clearslot
- the name of the slot to clear
-
getChildInSlot
public static Component getChildInSlot(HasElement parent, String slot)
Gets the first child component of the parent that is in the specified slot.
Parameters:
parent
- the component to get child from, notnull
slot
- the name of the slot inside the parent, notnull
Returns:
a child component of the parent in the specified slot, or
null
if none is found
-
-