public class ComponentMapping extends ServerSideFeature
| 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, generateChangesFromEmptyallowsChanges, attachPotentialChild, detatchPotentialChild, getNodeprotected 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 nullpublic Optional<Component> getComponent()
public static Optional<Component> getComponent(StateNode node)
node - the state node for which to find a component, not
nullpublic void onAttach(boolean initialAttach)
NodeFeatureonAttach in class NodeFeatureinitialAttach - true if this is the first time the node is
attached to a StateTree, false otherwisepublic void onDetach()
NodeFeatureonDetach in class NodeFeatureCopyright © 2020. All rights reserved.