Package com.vaadin.flow.dom.impl
Class AbstractTextElementStateProvider
java.lang.Object
com.vaadin.flow.dom.impl.AbstractTextElementStateProvider
- All Implemented Interfaces:
 ElementStateProvider,Serializable
- Direct Known Subclasses:
 BasicTextElementStateProvider
public abstract class AbstractTextElementStateProvider
extends Object
implements ElementStateProvider
Abstract element state provider for text nodes. Operations that are not
 applicable for text nodes throw 
UnsupportedOperationException.
 For internal use only. May be renamed or removed in a future release.
- Since:
 - 1.0
 - Author:
 - Vaadin Ltd
 - See Also:
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionaddEventListener(StateNode node, String eventType, DomEventListener listener) Adds a DOM event listener.addPropertyChangeListener(StateNode node, String name, PropertyChangeListener listener) Adds a property change listener.voidappendVirtualChild(StateNode node, Element child, String type, String payload) Append the given element as a virtual child.voidattachExistingElement(StateNode node, String tagName, Element previousSibling, ChildElementConsumer callback) Attaches a child element with the giventagNamewhich is the next sibling for thepreviousSibling.attachShadow(StateNode node) Attaches the shadow root for thenode.getAttribute(StateNode node, String attribute) Gets the value of the given attribute.getAttributeNames(StateNode node) Gets the defined attribute names.Returns the child element at the given position.intgetChildCount(StateNode node) Gets the number of child elements.getClassList(StateNode node) Gets a list representation of all CSS class names set for an element.getProperty(StateNode node, String name) Gets the value of the given property.getPropertyNames(StateNode node) Gets the defined property names.getShadowRoot(StateNode node) Gets shadow root for thenodeif it has been attached.Returns a style instance for managing element inline styles.Gets the tag name for the given node.booleanhasAttribute(StateNode node, String attribute) Checks if the given attribute has been set.booleanhasProperty(StateNode node, String name) Checks if the given property has been set.voidinsertChild(StateNode node, int index, Element child) Inserts the given child at the given position.booleanisTextNode(StateNode node) Checks if the state node represents a text node.booleanGets thenodevisibility.voidremoveAllChildren(StateNode node) Removes all child elements.voidremoveAttribute(StateNode node, String attribute) Removes the given attribute if it has been set.voidremoveChild(StateNode node, int index) Removes the child at the given position.voidremoveChild(StateNode node, Element child) Removes the given child.voidremoveProperty(StateNode node, String name) Removes the given property if it has been set.voidsetAttribute(StateNode node, String attribute, AbstractStreamResource resource) Sets the given attribute to the givenStreamResourcevalue.voidsetAttribute(StateNode node, String attribute, String value) Sets the given attribute to the given value.voidsetProperty(StateNode node, String name, Serializable value, boolean emitChange) Sets the given property to the given value.voidsetVisible(StateNode node, boolean visible) Sets thenodevisibility.voidvisit(StateNode node, NodeVisitor visitor) Visit thenodeapplyingvisitorto it and its descendants based on the return value from the visitor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.dom.ElementStateProvider
getComponent, getParent, getTextContent, setComponent, setTextContent, supports 
- 
Constructor Details
- 
AbstractTextElementStateProvider
public AbstractTextElementStateProvider() 
 - 
 - 
Method Details
- 
isTextNode
Description copied from interface:ElementStateProviderChecks if the state node represents a text node.- Specified by:
 isTextNodein interfaceElementStateProvider- Parameters:
 node- the node to check- Returns:
 trueif the state node represents a text node; otherwisefalse
 - 
getTag
Description copied from interface:ElementStateProviderGets the tag name for the given node.- Specified by:
 getTagin interfaceElementStateProvider- Parameters:
 node- the node containing the data- Returns:
 - the tag name
 
 - 
setAttribute
Description copied from interface:ElementStateProviderSets the given attribute to the given value.- Specified by:
 setAttributein interfaceElementStateProvider- Parameters:
 node- the node containing the dataattribute- the attribute name, not nullvalue- the attribute value
 - 
getAttribute
Description copied from interface:ElementStateProviderGets the value of the given attribute.- Specified by:
 getAttributein interfaceElementStateProvider- Parameters:
 node- the node containing the dataattribute- the attribute name, not null- Returns:
 - the attribute value or null if the attribute has not been set
 
 - 
hasAttribute
Description copied from interface:ElementStateProviderChecks if the given attribute has been set.- Specified by:
 hasAttributein interfaceElementStateProvider- Parameters:
 node- the node containing the dataattribute- the attribute name, not null- Returns:
 - true if the attribute has been set, false otherwise
 
 - 
removeAttribute
Description copied from interface:ElementStateProviderRemoves the given attribute if it has been set.- Specified by:
 removeAttributein interfaceElementStateProvider- Parameters:
 node- the node containing the dataattribute- the attribute name, not null
 - 
getAttributeNames
Description copied from interface:ElementStateProviderGets the defined attribute names.- Specified by:
 getAttributeNamesin interfaceElementStateProvider- Parameters:
 node- the node containing the data- Returns:
 - the defined attribute names
 
 - 
getChildCount
Description copied from interface:ElementStateProviderGets the number of child elements.- Specified by:
 getChildCountin interfaceElementStateProvider- Parameters:
 node- the node containing the data- Returns:
 - the number of child elements
 
 - 
getChild
Description copied from interface:ElementStateProviderReturns the child element at the given position.- Specified by:
 getChildin interfaceElementStateProvider- Parameters:
 node- the node containing the dataindex- the index of the child element to return- Returns:
 - the child element
 
 - 
insertChild
Description copied from interface:ElementStateProviderInserts the given child at the given position.- Specified by:
 insertChildin interfaceElementStateProvider- Parameters:
 node- the node containing the dataindex- the position at which to insert the new childchild- the child element to insert
 - 
removeChild
Description copied from interface:ElementStateProviderRemoves the child at the given position.- Specified by:
 removeChildin interfaceElementStateProvider- Parameters:
 node- the node containing the dataindex- the position of the child element to remove
 - 
removeChild
Description copied from interface:ElementStateProviderRemoves the given child.- Specified by:
 removeChildin interfaceElementStateProvider- Parameters:
 node- the node containing the datachild- the child element to remove
 - 
removeAllChildren
Description copied from interface:ElementStateProviderRemoves all child elements.- Specified by:
 removeAllChildrenin interfaceElementStateProvider- Parameters:
 node- the node containing the data
 - 
addEventListener
public DomListenerRegistration addEventListener(StateNode node, String eventType, DomEventListener listener) Description copied from interface:ElementStateProviderAdds a DOM event listener.- Specified by:
 addEventListenerin interfaceElementStateProvider- Parameters:
 node- the node containing the dataeventType- the event typelistener- the listener- Returns:
 - a handle for configuring or removing the listener
 
 - 
getProperty
Description copied from interface:ElementStateProviderGets the value of the given property.- Specified by:
 getPropertyin interfaceElementStateProvider- Parameters:
 node- the node containing the dataname- the property name, not null- Returns:
 - the property value, or 
nullif the property has not been set 
 - 
setProperty
Description copied from interface:ElementStateProviderSets the given property to the given value.- Specified by:
 setPropertyin interfaceElementStateProvider- Parameters:
 node- the node containing the dataname- the property name, notnullvalue- the property valueemitChange- true to create a change event for the client side
 - 
removeProperty
Description copied from interface:ElementStateProviderRemoves the given property if it has been set.- Specified by:
 removePropertyin interfaceElementStateProvider- Parameters:
 node- the node containing the dataname- the property name, notnull
 - 
hasProperty
Description copied from interface:ElementStateProviderChecks if the given property has been set.- Specified by:
 hasPropertyin interfaceElementStateProvider- Parameters:
 node- the node containing the dataname- the property name, notnull- Returns:
 trueif the property has been set,falseotherwise
 - 
getPropertyNames
Description copied from interface:ElementStateProviderGets the defined property names.- Specified by:
 getPropertyNamesin interfaceElementStateProvider- Parameters:
 node- the node containing the data- Returns:
 - the defined property names
 
 - 
getClassList
Description copied from interface:ElementStateProviderGets a list representation of all CSS class names set for an element.- Specified by:
 getClassListin interfaceElementStateProvider- Parameters:
 node- the node containing the data- Returns:
 - the class list, never 
null 
 - 
getStyle
Description copied from interface:ElementStateProviderReturns a style instance for managing element inline styles.- Specified by:
 getStylein interfaceElementStateProvider- Parameters:
 node- the node containing the data- Returns:
 - the element styles
 
 - 
setAttribute
Description copied from interface:ElementStateProviderSets the given attribute to the givenStreamResourcevalue.- Specified by:
 setAttributein interfaceElementStateProvider- Parameters:
 node- the node containing the dataattribute- the attribute name, not nullresource- the attribute value, not null
 - 
addPropertyChangeListener
public Registration addPropertyChangeListener(StateNode node, String name, PropertyChangeListener listener) Description copied from interface:ElementStateProviderAdds a property change listener.- Specified by:
 addPropertyChangeListenerin interfaceElementStateProvider- Parameters:
 node- the node containing the propertyname- the property name to add the listener forlistener- listener to get notifications about property value changes- Returns:
 - an event registration handle for removing the listener
 
 - 
getShadowRoot
Description copied from interface:ElementStateProviderGets shadow root for thenodeif it has been attached.- Specified by:
 getShadowRootin interfaceElementStateProvider- Parameters:
 node- the node having a shadow root, notnull- Returns:
 - the shadow root of the 
node, may be null 
 - 
attachShadow
Description copied from interface:ElementStateProviderAttaches the shadow root for thenode.- Specified by:
 attachShadowin interfaceElementStateProvider- Parameters:
 node- the node to attach the shadow root- Returns:
 - the shadow root of the 
node 
 - 
attachExistingElement
public void attachExistingElement(StateNode node, String tagName, Element previousSibling, ChildElementConsumer callback) Description copied from interface:ElementStateProviderAttaches a child element with the giventagNamewhich is the next sibling for thepreviousSibling.The
previousSiblingparameter value can benullwhich means that the very first child with the giventagNamewill be used to attach (if any).- Specified by:
 attachExistingElementin interfaceElementStateProvider- Parameters:
 node- the parent nodetagName- the tag name of the element to attach, notnullpreviousSibling- previous sibling, may benullcallback- the callback which will be invoked with a server side element instance or an error will be reported, notnull
 - 
appendVirtualChild
Description copied from interface:ElementStateProviderAppend the given element as a virtual child.- Specified by:
 appendVirtualChildin interfaceElementStateProvider- Parameters:
 node- the node containing the datachild- the child element to addtype- the type of additional payload datapayload- the additional payload data
 - 
visit
Description copied from interface:ElementStateProviderVisit thenodeapplyingvisitorto it and its descendants based on the return value from the visitor.- Specified by:
 visitin interfaceElementStateProvider- Parameters:
 node- the node to visitvisitor- the visitor to apply to the node
 - 
setVisible
Description copied from interface:ElementStateProviderSets thenodevisibility.- Specified by:
 setVisiblein interfaceElementStateProvider- Parameters:
 node- the node containing the datavisible- the node visibility value
 - 
isVisible
Description copied from interface:ElementStateProviderGets thenodevisibility.- Specified by:
 isVisiblein interfaceElementStateProvider- Parameters:
 node- the node containing the data- Returns:
 - the node visibility
 
 
 -