public interface Node
These methods may be called multiple times during the generation of the tree, and they must return the same value every time.
DefaultNode| Modifier and Type | Method and Description |
|---|---|
default String |
getAnnotation()
Return a String here to display as a node annotation.
|
default NodeColor |
getAnnotationColor()
Return a color here for colored annotations.
|
Iterable<? extends Node> |
getChildren()
The node's child nodes.
|
default NodeColor |
getColor()
Return a color here for colored node text.
|
default String |
getKey()
An optional primary key for the node.
|
String |
getText()
The node's text.
|
@CheckForNull default String getAnnotation()
May contain line breaks. The line breaks must be in system-specific format (CRLF vs. LF).
Best create them using System.lineSeparator().
null for no annotation@CheckForNull default NodeColor getAnnotationColor()
null to use the color from the tree's color scheme. A value of
NodeColor.None indicates that the annotation must not be colored.@CheckForNull Iterable<? extends 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()
May contain line breaks. The line breaks must be in system-specific format (CRLF vs. LF).
Best create them using System.lineSeparator().