public class ComponentMapping extends ServerSideFeature
For internal use only. May be renamed or removed in a future release.
Modifier | Constructor and Description |
---|---|
protected |
ComponentMapping(StateNode node)
Creates an instance of this node feature.
|
Modifier and Type | Method and Description |
---|---|
Optional<Component> |
getComponent()
Gets the component this node has been mapped to, if any.
|
static Optional<Component> |
getComponent(StateNode node)
Gets the component mapped to the given state node.
|
void |
onAttach(boolean initialAttach)
Called when the state node has been attached to the state tree.
|
void |
onDetach()
Called when the state node has been detached from the state tree.
|
void |
setComponent(Component component)
Assigns the given component to this node.
|
collectChanges, forEachChild, generateChangesFromEmpty
allowsChanges, attachPotentialChild, detatchPotentialChild, getNode
protected ComponentMapping(StateNode node)
node
- the node that the feature belongs topublic void setComponent(Component component)
When assigning a component to the node, there must be no previously assigned component.
component
- the component to assign to this node, not null
public Optional<Component> getComponent()
public static Optional<Component> getComponent(StateNode node)
node
- the state node for which to find a component, not
null
public void onAttach(boolean initialAttach)
NodeFeature
onAttach
in class NodeFeature
initialAttach
- true
if this is the first time the node is
attached to a StateTree
, false
otherwisepublic void onDetach()
NodeFeature
onDetach
in class NodeFeature
Copyright © 2022. All rights reserved.