com.vaadin.flow.internal.nodefeature.
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:
public class ElementData extends NodeMap
Map of basic element information.
Since:
1.0
Author:
Vaadin Ltd
See Also:
-
-
Constructor Summary
Constructors Constructor and Description ElementData(StateNode node)
Creates a new element data map for the given node.
-
Method Summary
All Methods Modifier and Type Method and Description boolean
allowsChanges()
Returns
true
if the underlying node may report its changes.elemental.json.JsonValue
getPayload()
Gets the payload data of the element.
String
getTag()
Gets the tag name of the element.
boolean
isVisible()
Get element visibility.
void
setPayload(elemental.json.JsonValue payload)
Sets the payload data of the element.
void
setTag(String tag)
Sets the tag name of the element.
void
setVisible(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, 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:
NodeFeature
Returns
true
if the underlying node may report its changes.If its return value is
false
then 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:
allowsChanges
in classNodeFeature
Returns:
true
if the feature allows changes for the node,false
otherwiseSee Also:
-
-