| Constructor and Description |
|---|
DefaultNode()
Constructor that initializes a node which contains the empty string as its node text.
|
DefaultNode(String pText)
Constructor.
|
DefaultNode(String pText,
String pKey,
NodeColor pColorOverride,
String pAnnotation,
List<DefaultNode> pChildren) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(DefaultNode pChild) |
String |
getAnnotation()
Return a String here to display as a node annotation.
|
NodeColor |
getAnnotationColor()
Return a color here for colored annotations.
|
List<DefaultNode> |
getChildren()
The node's child nodes.
|
NodeColor |
getColor()
Return a color here for colored node text.
|
String |
getKey()
An optional primary key for the node.
|
String |
getText()
The node's text.
|
void |
setAnnotation(String pAnnotation) |
void |
setAnnotationColor(NodeColor pAnnotationColorOverride) |
void |
setChildren(List<DefaultNode> pChildren) |
void |
setColor(NodeColor pColorOverride) |
void |
setKey(String pKey) |
void |
setText(String pText) |
public DefaultNode()
public DefaultNode(String pText)
pText - the node's textpublic void addChild(@Nullable DefaultNode pChild)
@CheckForNull public String getAnnotation()
NodeMay contain line breaks. The line breaks must be in system-specific format (CRLF vs. LF).
Best create them using System.lineSeparator().
getAnnotation in interface Nodenull for no annotation@CheckForNull public NodeColor getAnnotationColor()
NodegetAnnotationColor in interface Nodenull to use the color from the tree's color scheme. A value of
NodeColor.None indicates that the annotation must not be colored.@Nonnull public List<DefaultNode> getChildren()
Nodenull (shouldn't, but we
can handle it).getChildren in interface Nodenull / empty if this is a leaf node@CheckForNull public NodeColor getColor()
NodegetColor in interface Nodenull to use the color from the tree's color scheme. A value of
NodeColor.None indicates that the node must not be colored.@CheckForNull public String getKey()
NodeIdentityScheme.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 public String getText()
NodeMay contain line breaks. The line breaks must be in system-specific format (CRLF vs. LF).
Best create them using System.lineSeparator().
public void setChildren(@Nullable List<DefaultNode> pChildren)