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)
| 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. |