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 void
forEachChild(Consumer<StateNode> action)
Passes each child node instance to the given consumer.ChildElementConsumer
getCallback(StateNode node)
Gets callback of the registerednode
.Node<?>
getParent(StateNode node)
Gets parentNode
of the registerednode
.Element
getPreviousSibling(StateNode node)
Gets previous sibling of the registerednode
.void
register(Node<?> parent, Element previousSibling, StateNode child, ChildElementConsumer callback)
Registers the data for thechild
node requested as being attached to an existing element.void
unregister(StateNode node)
Unregister thenode
and 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 thechild
node requested as being attached to an existing element.- Parameters:
parent
- parent node of thechild
previousSibling
- 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 parentNode
of 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 thenode
and clean up all associated data.- Parameters:
node
- the registered state node
-
forEachChild
public void forEachChild(Consumer<StateNode> action)
Description copied from class:NodeFeature
Passes each child node instance to the given consumer.- Overrides:
forEachChild
in classServerSideFeature
- Parameters:
action
- the consumer that accepts each child
-
-