MCPcopy Create free account
hub / github.com/BaseXdb/basex / label

Method label

basex-core/src/main/java/org/basex/gui/view/ViewData.java:98–110  ·  view source on GitHub ↗

Returns a label for the specified node. @param opts gui options @param data data reference @param pre PRE value @return name

(final GUIOptions opts, final Data data, final int pre)

Source from the content-addressed store, hash-verified

96 * @return name
97 */
98 public static byte[] label(final GUIOptions opts, final Data data, final int pre) {
99 if(data.kind(pre) == Data.ELEM) {
100 final String labels = opts.get(GUIOptions.LABELS);
101 if(!labels.isEmpty()) {
102 final int id = labelID(data, labels);
103 if(id != 0) {
104 final byte[] value = data.attValue(id, pre);
105 if(value != null) return value;
106 }
107 }
108 }
109 return Token.chop(text(data, pre), 32);
110 }
111
112 /**
113 * Returns the name ID of the specified node.

Callers 3

paintComponentMethod · 0.95
drawRectanglesMethod · 0.95
textMethod · 0.95

Calls 7

labelIDMethod · 0.95
chopMethod · 0.95
textMethod · 0.95
attValueMethod · 0.80
kindMethod · 0.65
getMethod · 0.65
isEmptyMethod · 0.45

Tested by

no test coverage detected