com.vaadin.flow.dom.impl.
Class AbstractNodeStateProvider
All Implemented Interfaces:
Direct Known Subclasses:
Abstract implementation of the ElementStateProvider
related to the
composition essence of the provider.
For internal use only. May be renamed or removed in a future release.
Since:
1.0
Author:
Vaadin Ltd
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendVirtualChild
(StateNode node, Element child, String type, String payload) Append the given element as a virtual child.
void
attachExistingElement
(StateNode node, String tagName, Element previousSibling, ChildElementConsumer callback) Attaches a child element with the given
tagName
which is the next sibling for thepreviousSibling
.Returns the child element at the given position.
int
getChildCount
(StateNode node) Gets the number of child elements.
protected abstract Node<?>
Gets the flyweight instance for the
node
supported by the provider.Gets the parent element.
protected abstract Class<? extends NodeFeature>[]
Returns the features supported by the provider.
void
insertChild
(StateNode node, int index, Element child) Inserts the given child at the given position.
void
removeAllChildren
(StateNode node) Removes all child elements.
void
removeChild
(StateNode node, int index) Removes the child at the given position.
void
removeChild
(StateNode node, Element child) Removes the given child.
boolean
Checks if the element state provider supports the given state node.
protected void
visitDescendants
(Node<?> node, NodeVisitor visitor) Apply the
visitor
for the descendants of thenode
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.dom.ElementStateProvider
addEventListener, addPropertyChangeListener, attachShadow, getAttribute, getAttributeNames, getClassList, getComponent, getProperty, getPropertyNames, getShadowRoot, getStyle, getTag, getTextContent, hasAttribute, hasProperty, isTextNode, isVisible, removeAttribute, removeProperty, setAttribute, setAttribute, setComponent, setProperty, setTextContent, setVisible, visit
-
Constructor Details
-
AbstractNodeStateProvider
public AbstractNodeStateProvider()
-
-
Method Details
-
supports
Description copied from interface:
ElementStateProvider
Checks if the element state provider supports the given state node.
Specified by:
supports
in interfaceElementStateProvider
Parameters:
node
- the state node to checkReturns:
true if the element state provider is compatible with the given state node, false otherwise
-
getProviderFeatures
Returns the features supported by the provider.
Returns:
features supported by the provider
-
getParent
Description copied from interface:
ElementStateProvider
Gets the parent element.
Specified by:
getParent
in interfaceElementStateProvider
Parameters:
node
- the node containing the dataReturns:
the parent element or null if the element has no parent
-
getChildCount
Description copied from interface:
ElementStateProvider
Gets the number of child elements.
Specified by:
getChildCount
in interfaceElementStateProvider
Parameters:
node
- the node containing the dataReturns:
the number of child elements
-
getChild
Description copied from interface:
ElementStateProvider
Returns the child element at the given position.
Specified by:
getChild
in interfaceElementStateProvider
Parameters:
node
- the node containing the dataindex
- the index of the child element to returnReturns:
the child element
-
insertChild
Description copied from interface:
ElementStateProvider
Inserts the given child at the given position.
Specified by:
insertChild
in interfaceElementStateProvider
Parameters:
node
- the node containing the dataindex
- the position at which to insert the new childchild
- the child element to insert -
removeChild
Description copied from interface:
ElementStateProvider
Removes the child at the given position.
Specified by:
removeChild
in interfaceElementStateProvider
Parameters:
node
- the node containing the dataindex
- the position of the child element to remove -
removeAllChildren
Description copied from interface:
ElementStateProvider
Removes all child elements.
Specified by:
removeAllChildren
in interfaceElementStateProvider
Parameters:
node
- the node containing the data -
removeChild
Description copied from interface:
ElementStateProvider
Removes the given child.
Specified by:
removeChild
in interfaceElementStateProvider
Parameters:
node
- the node containing the datachild
- the child element to remove -
attachExistingElement
public void attachExistingElement(StateNode node, String tagName, Element previousSibling, ChildElementConsumer callback) Description copied from interface:
ElementStateProvider
Attaches a child element with the given
tagName
which is the next sibling for thepreviousSibling
.The
previousSibling
parameter value can benull
which means that the very first child with the giventagName
will be used to attach (if any).Specified by:
attachExistingElement
in interfaceElementStateProvider
Parameters:
node
- the parent nodetagName
- the tag name of the element to attach, notnull
previousSibling
- previous sibling, may benull
callback
- the callback which will be invoked with a server side element instance or an error will be reported, notnull
-
appendVirtualChild
Description copied from interface:
ElementStateProvider
Append the given element as a virtual child.
Specified by:
appendVirtualChild
in interfaceElementStateProvider
Parameters:
node
- the node containing the datachild
- the child element to addtype
- the type of additional payload datapayload
- the additional payload data -
visitDescendants
Apply the
visitor
for the descendants of thenode
.Parameters:
node
- the node whose descendants are targets to apply the visitorvisitor
- the visitor to apply -
getNode
Gets the flyweight instance for the
node
supported by the provider.Parameters:
node
- the node to wrap into flyweightReturns:
the flyweight instance for the
node
See Also:
-