public abstract class AbstractTextElementStateProvider extends Object implements ElementStateProvider
UnsupportedOperationException
.Constructor and Description |
---|
AbstractTextElementStateProvider() |
Modifier and Type | Method and Description |
---|---|
DomListenerRegistration |
addEventListener(StateNode node,
String eventType,
DomEventListener listener)
Adds a DOM event listener.
|
Registration |
addPropertyChangeListener(StateNode node,
String name,
PropertyChangeListener listener)
Adds a property change listener.
|
void |
appendVirtualChild(StateNode node,
Element child,
String type,
String payload)
Append the given element as a virtual child.
|
void |
attachExistingElement(StateNode node,
String tagName,
Element previousSibling,
ChildElementConsumer callback)
Attaches a child element with the given
tagName which is the next
sibling for the previousSibling . |
StateNode |
attachShadow(StateNode node)
Attaches the shadow root for the
node . |
String |
getAttribute(StateNode node,
String attribute)
Gets the value of the given attribute.
|
Stream<String> |
getAttributeNames(StateNode node)
Gets the defined attribute names.
|
Element |
getChild(StateNode node,
int index)
Returns the child element at the given position.
|
int |
getChildCount(StateNode node)
Gets the number of child elements.
|
ClassList |
getClassList(StateNode node)
Gets a list representation of all CSS class names set for an element.
|
Serializable |
getProperty(StateNode node,
String name)
Gets the value of the given property.
|
Stream<String> |
getPropertyNames(StateNode node)
Gets the defined property names.
|
StateNode |
getShadowRoot(StateNode node)
Gets shadow root for the
node if it has been attached. |
Style |
getStyle(StateNode node)
Returns a style instance for managing element inline styles.
|
String |
getTag(StateNode node)
Gets the tag name for the given node.
|
boolean |
hasAttribute(StateNode node,
String attribute)
Checks if the given attribute has been set.
|
boolean |
hasProperty(StateNode node,
String name)
Checks if the given property has been set.
|
void |
insertChild(StateNode node,
int index,
Element child)
Inserts the given child at the given position.
|
boolean |
isTextNode(StateNode node)
Checks if the state node represents a text node.
|
boolean |
isVisible(StateNode node)
Gets the
node visibility. |
void |
removeAllChildren(StateNode node)
Removes all child elements.
|
void |
removeAttribute(StateNode node,
String attribute)
Removes the given attribute if it has been set.
|
void |
removeChild(StateNode node,
Element child)
Removes the given child.
|
void |
removeChild(StateNode node,
int index)
Removes the child at the given position.
|
void |
removeProperty(StateNode node,
String name)
Removes the given property if it has been set.
|
void |
setAttribute(StateNode node,
String attribute,
AbstractStreamResource resource)
Sets the given attribute to the given
StreamResource value. |
void |
setAttribute(StateNode node,
String attribute,
String value)
Sets the given attribute to the given value.
|
void |
setProperty(StateNode node,
String name,
Serializable value,
boolean emitChange)
Sets the given property to the given value.
|
void |
setVisible(StateNode node,
boolean visible)
Sets the
node visibility. |
void |
visit(StateNode node,
NodeVisitor visitor)
Visit the
node applying visitor to it and its descendants
based on the return value from the visitor. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getComponent, getParent, getTextContent, setComponent, setTextContent, supports
public boolean isTextNode(StateNode node)
ElementStateProvider
isTextNode
in interface ElementStateProvider
node
- the node to checktrue
if the state node represents a text node;
otherwise false
public String getTag(StateNode node)
ElementStateProvider
getTag
in interface ElementStateProvider
node
- the node containing the datapublic void setAttribute(StateNode node, String attribute, String value)
ElementStateProvider
setAttribute
in interface ElementStateProvider
node
- the node containing the dataattribute
- the attribute name, not nullvalue
- the attribute valuepublic String getAttribute(StateNode node, String attribute)
ElementStateProvider
getAttribute
in interface ElementStateProvider
node
- the node containing the dataattribute
- the attribute name, not nullpublic boolean hasAttribute(StateNode node, String attribute)
ElementStateProvider
hasAttribute
in interface ElementStateProvider
node
- the node containing the dataattribute
- the attribute name, not nullpublic void removeAttribute(StateNode node, String attribute)
ElementStateProvider
removeAttribute
in interface ElementStateProvider
node
- the node containing the dataattribute
- the attribute name, not nullpublic Stream<String> getAttributeNames(StateNode node)
ElementStateProvider
getAttributeNames
in interface ElementStateProvider
node
- the node containing the datapublic int getChildCount(StateNode node)
ElementStateProvider
getChildCount
in interface ElementStateProvider
node
- the node containing the datapublic Element getChild(StateNode node, int index)
ElementStateProvider
getChild
in interface ElementStateProvider
node
- the node containing the dataindex
- the index of the child element to returnpublic void insertChild(StateNode node, int index, Element child)
ElementStateProvider
insertChild
in interface ElementStateProvider
node
- the node containing the dataindex
- the position at which to insert the new childchild
- the child element to insertpublic void removeChild(StateNode node, int index)
ElementStateProvider
removeChild
in interface ElementStateProvider
node
- the node containing the dataindex
- the position of the child element to removepublic void removeChild(StateNode node, Element child)
ElementStateProvider
removeChild
in interface ElementStateProvider
node
- the node containing the datachild
- the child element to removepublic void removeAllChildren(StateNode node)
ElementStateProvider
removeAllChildren
in interface ElementStateProvider
node
- the node containing the datapublic DomListenerRegistration addEventListener(StateNode node, String eventType, DomEventListener listener)
ElementStateProvider
addEventListener
in interface ElementStateProvider
node
- the node containing the dataeventType
- the event typelistener
- the listenerpublic Serializable getProperty(StateNode node, String name)
ElementStateProvider
getProperty
in interface ElementStateProvider
node
- the node containing the dataname
- the property name, not nullnull
if the property has not
been setpublic void setProperty(StateNode node, String name, Serializable value, boolean emitChange)
ElementStateProvider
setProperty
in interface ElementStateProvider
node
- the node containing the dataname
- the property name, not null
value
- the property valueemitChange
- true to create a change event for the client sidepublic void removeProperty(StateNode node, String name)
ElementStateProvider
removeProperty
in interface ElementStateProvider
node
- the node containing the dataname
- the property name, not null
public boolean hasProperty(StateNode node, String name)
ElementStateProvider
hasProperty
in interface ElementStateProvider
node
- the node containing the dataname
- the property name, not null
true
if the property has been set,
false
otherwisepublic Stream<String> getPropertyNames(StateNode node)
ElementStateProvider
getPropertyNames
in interface ElementStateProvider
node
- the node containing the datapublic ClassList getClassList(StateNode node)
ElementStateProvider
getClassList
in interface ElementStateProvider
node
- the node containing the datanull
public Style getStyle(StateNode node)
ElementStateProvider
getStyle
in interface ElementStateProvider
node
- the node containing the datapublic void setAttribute(StateNode node, String attribute, AbstractStreamResource resource)
ElementStateProvider
StreamResource
value.setAttribute
in interface ElementStateProvider
node
- the node containing the dataattribute
- the attribute name, not nullresource
- the attribute value, not nullpublic Registration addPropertyChangeListener(StateNode node, String name, PropertyChangeListener listener)
ElementStateProvider
addPropertyChangeListener
in interface ElementStateProvider
node
- the node containing the propertyname
- the property name to add the listener forlistener
- listener to get notifications about property value changespublic StateNode getShadowRoot(StateNode node)
ElementStateProvider
node
if it has been attached.getShadowRoot
in interface ElementStateProvider
node
- the node having a shadow root, not null
node
, may be nullpublic StateNode attachShadow(StateNode node)
ElementStateProvider
node
.attachShadow
in interface ElementStateProvider
node
- the node to attach the shadow rootnode
public void attachExistingElement(StateNode node, String tagName, Element previousSibling, ChildElementConsumer callback)
ElementStateProvider
tagName
which is the next
sibling for the previousSibling
.
The previousSibling
parameter value can be null
which
means that the very first child with the given tagName
will be
used to attach (if any).
attachExistingElement
in interface ElementStateProvider
node
- the parent nodetagName
- the tag name of the element to attach, not null
previousSibling
- previous sibling, may be null
callback
- the callback which will be invoked with a server side element
instance or an error will be reported, not null
public void appendVirtualChild(StateNode node, Element child, String type, String payload)
ElementStateProvider
appendVirtualChild
in interface ElementStateProvider
node
- the node containing the datachild
- the child element to addtype
- the type of additional payload datapayload
- the additional payload datapublic void visit(StateNode node, NodeVisitor visitor)
ElementStateProvider
node
applying visitor
to it and its descendants
based on the return value from the visitor.visit
in interface ElementStateProvider
node
- the node to visitvisitor
- the visitor to apply to the nodepublic void setVisible(StateNode node, boolean visible)
ElementStateProvider
node
visibility.setVisible
in interface ElementStateProvider
node
- the node containing the datavisible
- the node visibility valuepublic boolean isVisible(StateNode node)
ElementStateProvider
node
visibility.isVisible
in interface ElementStateProvider
node
- the node containing the dataCopyright © 2021. All rights reserved.