public interface Node
DefaultNode| Modifier and Type | Method and Description |
|---|---|
default String |
getAnnotation()
Return a String here to display as a node annotation.
|
Iterable<Node> |
getChildren()
The node's child nodes.
|
default NodeColor |
getColor()
Return a color here for colored nodes.
|
default String |
getKey()
An optional primary key for the node.
|
String |
getText()
The node's text.
|
@CheckForNull default String getAnnotation()
null for no annotation@CheckForNull Iterable<Node> getChildren()
null (shouldn't, but we
can handle it).null / empty if this is a leaf node@CheckForNull default NodeColor getColor()
null to use the color from the tree's color scheme. A value of
NodeColor.None indicates that the node must not be colored.@CheckForNull default String getKey()
IdentityScheme.ByKey is explicitly selected. Otherwise, this method should be left to its default
implementation.
If you actually use this value (because you've chosen IdentityScheme.ByKey), then you should make
sure that it not return null. All nodes which do that will be considered the same node then
(which may be what you want. I'm just saying).
@CheckForNull String getText()