public abstract class AbstractNodeStateProvider extends Object implements ElementStateProvider
ElementStateProvider
related to the
composition essence of the provider.
For internal use only. May be renamed or removed in a future release.
Constructor and Description |
---|
AbstractNodeStateProvider() |
Modifier and Type | Method and Description |
---|---|
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 . |
Element |
getChild(StateNode node,
int index)
Returns the child element at the given position.
|
int |
getChildCount(StateNode node)
Gets the number of child elements.
|
protected abstract Node<?> |
getNode(StateNode node)
Gets the flyweight instance for the
node supported by the
provider. |
Node |
getParent(StateNode node)
Gets the parent element.
|
protected abstract Class<? extends NodeFeature>[] |
getProviderFeatures()
Returns the features supported by the provider.
|
void |
insertChild(StateNode node,
int index,
Element child)
Inserts the given child at the given position.
|
void |
removeAllChildren(StateNode node)
Removes all child elements.
|
void |
removeChild(StateNode node,
Element child)
Removes the given child.
|
void |
removeChild(StateNode node,
int index)
Removes the child at the given position.
|
boolean |
supports(StateNode node)
Checks if the element state provider supports the given state node.
|
protected void |
visitDescendants(Node<?> node,
NodeVisitor visitor)
Apply the
visitor for the descendants of the node . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEventListener, addPropertyChangeListener, attachShadow, getAttribute, getAttributeNames, getClassList, getComponent, getProperty, getPropertyNames, getShadowRoot, getStyle, getTag, getTextContent, hasAttribute, hasProperty, isTextNode, isVisible, removeAttribute, removeProperty, setAttribute, setAttribute, setComponent, setProperty, setTextContent, setVisible, visit
public boolean supports(StateNode node)
ElementStateProvider
supports
in interface ElementStateProvider
node
- the state node to checkprotected abstract Class<? extends NodeFeature>[] getProviderFeatures()
public Node getParent(StateNode node)
ElementStateProvider
getParent
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 removeAllChildren(StateNode node)
ElementStateProvider
removeAllChildren
in interface ElementStateProvider
node
- the node containing the datapublic void removeChild(StateNode node, Element child)
ElementStateProvider
removeChild
in interface ElementStateProvider
node
- the node containing the datachild
- the child element to removepublic 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 dataprotected void visitDescendants(Node<?> node, NodeVisitor visitor)
visitor
for the descendants of the node
.node
- the node whose descendants are targets to apply the visitorvisitor
- the visitor to applyprotected abstract Node<?> getNode(StateNode node)
node
supported by the
provider.node
- the node to wrap into flyweightnode
supports(StateNode)
Copyright © 2021. All rights reserved.