Package com.vaadin.flow.dom
Class ShadowRoot
- java.lang.Object
-
- com.vaadin.flow.dom.Node<ShadowRoot>
-
- com.vaadin.flow.dom.ShadowRoot
-
- All Implemented Interfaces:
Serializable
public class ShadowRoot extends Node<ShadowRoot>
Represents a shadow dom root of an element.The root can be created by
Element.attachShadow().- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
Element.attachShadow(), Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ShadowRootget(StateNode node)Gets the shadow root instance mapped to the given state node.ElementgetHost()Node<?>getParentNode()Gets the parent node.protected ShadowRootgetSelf()Gets the narrow typed reference to this object.ShadowRootStateProvidergetStateProvider()Gets the state provider for this element.static booleanisShadowRoot(StateNode node)Checks whether the givennodeis a shadow root node.-
Methods inherited from class com.vaadin.flow.dom.Node
accept, appendChild, appendChild, appendVirtualChild, appendVirtualChild, ensureChildHasParent, equals, getChild, getChildCount, getChildren, getNode, hashCode, indexOfChild, insertChild, insertChild, isVirtualChild, removeAllChildren, removeChild, removeChild, removeChild, removeVirtualChild, removeVirtualChild, setChild
-
-
-
-
Method Detail
-
get
public static ShadowRoot get(StateNode node)
Gets the shadow root instance mapped to the given state node.- Parameters:
node- the state node, notnull- Returns:
- the shadow root for the node, not
null
-
isShadowRoot
public static boolean isShadowRoot(StateNode node)
Checks whether the givennodeis a shadow root node.- Parameters:
node- the state node, notnull- Returns:
trueif it's a shadow root, notnull
-
getParentNode
public Node<?> getParentNode()
Description copied from class:NodeGets the parent node.- Overrides:
getParentNodein classNode<ShadowRoot>- Returns:
- the parent node or null if this element does not have a parent
-
getHost
public Element getHost()
-
getSelf
protected ShadowRoot getSelf()
Description copied from class:NodeGets the narrow typed reference to this object.- Specified by:
getSelfin classNode<ShadowRoot>- Returns:
- this object casted to its type
-
getStateProvider
public ShadowRootStateProvider getStateProvider()
Description copied from class:NodeGets the state provider for this element.This method is meant for internal use only.
- Overrides:
getStateProviderin classNode<ShadowRoot>- Returns:
- the state provider for this element
-
-