code: public static String getPath(Treenode item, boolean useLabels) {
          StringBuilder sb = new StringBuilder();
          boolean needsDelim = false;
  
          while (item != null) {
              if (needsDelim) {
                  sb.insert(0, '\\');
              } else {
                  needsDelim = true;
              }
  
              sb.insert(0, useLabels ? item.getLabel() : item.getIndex());
              item = (Treenode) item.getParent();
          }
  
          return sb.toString();
      }
docs: Returns the path of the specified tree node. This consists of the indexes or labels of this
  and all parent nodes separated by a "\" character.
  
  @param item The node (tree item) whose path is to be returned. If this value is null, a zero
  length string is returned.
  @param useLabels If true, use the labels as identifiers; otherwise, use indexes.
  @return The path of the node as described.