Class AttachExistingElementFeature
- java.lang.Object
-
- com.vaadin.flow.internal.nodefeature.NodeFeature
-
- com.vaadin.flow.internal.nodefeature.ServerSideFeature
-
- com.vaadin.flow.internal.nodefeature.AttachExistingElementFeature
-
- All Implemented Interfaces:
Serializable
public class AttachExistingElementFeature extends ServerSideFeature
Temporary storage of data required to handle existing element attachment callback from the client side.The data is going to be destroyed once the response from the client side is received.
For internal use only. May be renamed or removed in a future release.
- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AttachExistingElementFeature(StateNode node)Creates a new instance for the given node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidforEachChild(Consumer<StateNode> action)Passes each child node instance to the given consumer.ChildElementConsumergetCallback(StateNode node)Gets callback of the registerednode.Node<?>getParent(StateNode node)Gets parentNodeof the registerednode.ElementgetPreviousSibling(StateNode node)Gets previous sibling of the registerednode.voidregister(Node<?> parent, Element previousSibling, StateNode child, ChildElementConsumer callback)Registers the data for thechildnode requested as being attached to an existing element.voidunregister(StateNode node)Unregister thenodeand clean up all associated data.-
Methods inherited from class com.vaadin.flow.internal.nodefeature.ServerSideFeature
collectChanges, generateChangesFromEmpty
-
Methods inherited from class com.vaadin.flow.internal.nodefeature.NodeFeature
allowsChanges, attachPotentialChild, detatchPotentialChild, getNode, onAttach, onDetach
-
-
-
-
Constructor Detail
-
AttachExistingElementFeature
public AttachExistingElementFeature(StateNode node)
Creates a new instance for the given node.- Parameters:
node- the node that the feature belongs to
-
-
Method Detail
-
register
public void register(Node<?> parent, Element previousSibling, StateNode child, ChildElementConsumer callback)
Registers the data for thechildnode requested as being attached to an existing element.- Parameters:
parent- parent node of thechildpreviousSibling- previous sibling for the requested existing elementchild- the state node that is going to be associated with the existing elementcallback- the callback to report the result
-
getCallback
public ChildElementConsumer getCallback(StateNode node)
Gets callback of the registerednode.- Parameters:
node- the registered state node- Returns:
- the registered callback for the
node
-
getParent
public Node<?> getParent(StateNode node)
Gets parentNodeof the registerednode.- Parameters:
node- the registered state node- Returns:
- the registered parent for the
node
-
getPreviousSibling
public Element getPreviousSibling(StateNode node)
Gets previous sibling of the registerednode.- Parameters:
node- the registered state node- Returns:
- the registered previous sibling for the
node
-
unregister
public void unregister(StateNode node)
Unregister thenodeand clean up all associated data.- Parameters:
node- the registered state node
-
forEachChild
public void forEachChild(Consumer<StateNode> action)
Description copied from class:NodeFeaturePasses each child node instance to the given consumer.- Overrides:
forEachChildin classServerSideFeature- Parameters:
action- the consumer that accepts each child
-
-