Class ElementUtilsKt
-
- All Implemented Interfaces:
public final class ElementUtilsKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static StringtextRecursively2private final static StringtextRecursivelyprivate final static Elementelement
-
Method Summary
Modifier and Type Method Description final StringgetTextRecursively2()final StringgetTextRecursively()final ElementgetElement()final static Unit_fireDomEvent(Element $self, DomEvent event)Fires a DOM event on this element. final static UnitinsertBefore(Element $self, Element newNode, Element existingNode)Inserts newNode as a child, right before an existingNode. final static UnitsetOrRemoveAttribute(Element $self, String attribute, String value)Either calls Element.setAttribute (if the value is not null), or Element.removeAttribute (if the value is null). final static Unittoggle(ClassList $self, String className)Toggles className - removes it if it was there, or adds it if it wasn't there. final static List<Element>getVirtualChildren(Element $self)Returns all virtual child elements added via Element.appendVirtualChild. final static List<Element>getChildrenInSlot(Element $self, String slotName)Returns child elements with the slotattribute set to given slotName.final static UnitclearSlot(Element $self, String slotName)Removes all child elements from given slot, leaving it empty. final static List<Component>_findComponents(Element $self)Returns all components that are closest to this element. -
-
Method Detail
-
getTextRecursively2
final String getTextRecursively2()
-
getTextRecursively
final String getTextRecursively()
-
getElement
final Element getElement()
-
_fireDomEvent
final static Unit _fireDomEvent(Element $self, DomEvent event)
Fires a DOM event on this element.
-
insertBefore
final static Unit insertBefore(Element $self, Element newNode, Element existingNode)
Inserts newNode as a child, right before an existingNode. A counterpart for JavaScript DOM
Node.insertBefore().
-
setOrRemoveAttribute
final static Unit setOrRemoveAttribute(Element $self, String attribute, String value)
Either calls Element.setAttribute (if the value is not null), or Element.removeAttribute (if the value is null).
- Parameters:
attribute- the name of the attribute.
-
toggle
final static Unit toggle(ClassList $self, String className)
Toggles className - removes it if it was there, or adds it if it wasn't there.
- Parameters:
className- the class name to toggle, cannot contain spaces.
-
getVirtualChildren
final static List<Element> getVirtualChildren(Element $self)
Returns all virtual child elements added via Element.appendVirtualChild.
-
getChildrenInSlot
final static List<Element> getChildrenInSlot(Element $self, String slotName)
Returns child elements with the
slotattribute set to given slotName.
-
clearSlot
final static Unit clearSlot(Element $self, String slotName)
Removes all child elements from given slot, leaving it empty.
-
_findComponents
final static List<Component> _findComponents(Element $self)
Returns all components that are closest to this element.
-
-
-
-