Class ElementData
- java.lang.Object
-
- com.vaadin.flow.internal.nodefeature.NodeFeature
-
- com.vaadin.flow.internal.nodefeature.NodeMap
-
- com.vaadin.flow.internal.nodefeature.ElementData
-
- All Implemented Interfaces:
Serializable
public class ElementData extends NodeMap
Map of basic element information.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 ElementData(StateNode node)Creates a new element data map for the given node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsChanges()Returnstrueif the underlying node may report its changes.elemental.json.JsonValuegetPayload()Gets the payload data of the element.StringgetTag()Gets the tag name of the element.booleanisVisible()Get element visibility.voidsetPayload(elemental.json.JsonValue payload)Sets the payload data of the element.voidsetTag(String tag)Sets the tag name of the element.voidsetVisible(boolean visible)Set the visibility of the element.-
Methods inherited from class com.vaadin.flow.internal.nodefeature.NodeMap
clear, collectChanges, contains, forEachChild, generateChangesFromEmpty, get, getOrDefault, getOrDefault, getOrDefault, keySet, mayUpdateFromClient, producePutChange, put, put, remove, updateFromClient
-
Methods inherited from class com.vaadin.flow.internal.nodefeature.NodeFeature
attachPotentialChild, detatchPotentialChild, getNode, onAttach, onDetach
-
-
-
-
Constructor Detail
-
ElementData
public ElementData(StateNode node)
Creates a new element data map for the given node.- Parameters:
node- the node that the map belongs to
-
-
Method Detail
-
setTag
public void setTag(String tag)
Sets the tag name of the element.- Parameters:
tag- the tag name
-
getTag
public String getTag()
Gets the tag name of the element.- Returns:
- the tag name
-
setPayload
public void setPayload(elemental.json.JsonValue payload)
Sets the payload data of the element.- Parameters:
payload- the payload data
-
setVisible
public void setVisible(boolean visible)
Set the visibility of the element.- Parameters:
visible- is the element visible or hidden
-
isVisible
public boolean isVisible()
Get element visibility.- Returns:
- Element is visible by default
-
getPayload
public elemental.json.JsonValue getPayload()
Gets the payload data of the element.- Returns:
- the payload data of the element
-
allowsChanges
public boolean allowsChanges()
Description copied from class:NodeFeatureReturnstrueif the underlying node may report its changes.If its return value is
falsethen this node should be considered as "inactive" and should not send any changes to the client side at all or only changes for features that disallow the changes.Normally features don't control the node behavior so the default implementation returns
true. The feature which wants to control the node behavior should override this method.- Overrides:
allowsChangesin classNodeFeature- Returns:
trueif the feature allows changes for the node,falseotherwise- See Also:
StateNode.updateActiveState()
-
-