Class InertData
- All Implemented Interfaces:
Serializable
The inert status is only updated when the changes are written to the client side because the inert state changes are applied for upcoming requests from the client side. Thus when an RPC call (like any DOM event) causes a node to become inert, the inert state does not block any pending executions until changes are written to the client side.
Implementation notes: The inert state changes are collected like with client side changes (markAsDirty), but nothing is actually sent to the client side. This is just to make sure the changes are applied when needed, when writing changes to client side, instead of applying them immediately. By default the elements only have the inert data feature but as "not initialized" state which means that the node is not inert unless parent is inert, and thus it does not ignore parent inert by default. The inert data feature is initialized when the node will be made explicitly inert or to explicitly ignore parent inert data.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
collectChanges
(Consumer<NodeChange> collector) Collects all changes that are recorded for this feature.void
Generates all changes that would be needed to take this node from its initial empty state to its current state.boolean
Gets whether the inertness setting of ancestor nodes should be ignored.boolean
isInert()
Returns whether this node is explicitly inert and if not, then checks parents for the same.boolean
Gets whether the node itself has been set to be inert (regardless of its ancestors' inert setting).void
setIgnoreParentInert
(boolean ignoreParentInert) Sets whether or not the node should ignore parent's inert state or not.void
setInertSelf
(boolean inertSelf) Sets whether the node itself is inert.Methods inherited from class com.vaadin.flow.internal.nodefeature.ServerSideFeature
forEachChild
Methods inherited from class com.vaadin.flow.internal.nodefeature.NodeFeature
allowsChanges, attachPotentialChild, detatchPotentialChild, getNode, onAttach, onDetach
-
Constructor Details
-
InertData
Creates a new feature for the given node.- Parameters:
node
- the node which supports the feature
-
-
Method Details
-
setIgnoreParentInert
public void setIgnoreParentInert(boolean ignoreParentInert) Sets whether or not the node should ignore parent's inert state or not. By default the parent state is inheritedfalse
.- Parameters:
ignoreParentInert
-true
for ignoringfalse
for not
-
setInertSelf
public void setInertSelf(boolean inertSelf) Sets whether the node itself is inert. By default the node is not inert, unless parent is inert and inhering parent inert is not blocked.- Parameters:
inertSelf
- true for setting the node explicitly inert,false
for not
-
isInertSelf
public boolean isInertSelf()Gets whether the node itself has been set to be inert (regardless of its ancestors' inert setting).- Returns:
- whether this node has been set inert
-
isIgnoreParentInert
public boolean isIgnoreParentInert()Gets whether the inertness setting of ancestor nodes should be ignored.- Returns:
- whether this node should ignore its ancestors' inert setting
-
generateChangesFromEmpty
public void generateChangesFromEmpty()Description copied from class:NodeFeature
Generates all changes that would be needed to take this node from its initial empty state to its current state.- Overrides:
generateChangesFromEmpty
in classServerSideFeature
-
collectChanges
Description copied from class:NodeFeature
Collects all changes that are recorded for this feature.- Overrides:
collectChanges
in classServerSideFeature
- Parameters:
collector
- a consumer accepting node changes
-
isInert
public boolean isInert()Returns whether this node is explicitly inert and if not, then checks parents for the same. The returned value has been updated when the most recent changes have been written to the client side.- Returns:
true
for inert,false
for not
-