666768697071727374
public NavItem getParent() { if (tree == null) return null; Tree parent = tree.getParent(); return parent == null ? null : (NavItem) parent.getData(); }
131132133134135136137138139140141142
/** * Returns the previous sibling. */ public NavItem getPrevious() { Tree prevTree = tree.getPrevious(); if (prevTree == null) return null; else return (NavItem) prevTree.getData(); }
144145146147148149150151152153154155
/** * Returns the previous item in a preorder DFS traversal. */ public NavItem getPreviousPreorder() { Tree prevTree = tree.getPreviousPreorder(); if (prevTree == null) return null; else return (NavItem) prevTree.getData(); }
157158159160161162163164165166167168
/** * Returns the next sibling item. */ public NavItem getNext() { Tree nextTree = tree.getNext(); if (nextTree == null) return null; else return (NavItem) nextTree.getData(); }
170171172173174175176177178179180181
/** * Returns the next item in a preorder DFS traversal. */ public NavItem getNextPreorder() { Tree nextTree = tree.getNextPreorder(); if (nextTree == null) return null; else return (NavItem) nextTree.getData(); }
949596979899100101102103104
} public void init(Env env, Element root, String base) throws Exception { tree = new Tree(null); this.root = root; if (base == null || base == "") base = "/";
218219220221222223224225226227228
NavItem link = parent.findURL(test.getLink()); if (link == null) return null; Tree parentTree = link.getTree(); linkTree(link.getTree(), tree.getFirst()); this.tree = parent.tree; return this; }
237238239240241242243244245246
{ for (Tree child = subTree.getFirst(); child != null; child = child.getNext()) { NavItem item = (NavItem) child.getData(); Tree childTree = destTree.append(item); item.setTree(childTree); linkTree(childTree, child); } }
268269270271272273274275276277278279
url = normalizeURL(url); Iterator iter = tree.dfs(); while (iter.hasNext()) { Tree tree = (Tree) iter.next(); NavItem item = (NavItem) tree.getData(); if (item.getLink().equals(url)) { return item; } }
307308309310311312313314315316317
desc = descPattern.evalString(elt); item.setDescription(desc); item.setProduct(_productPattern.evalString(elt)); Tree childTree = tree.append(item); item.setTree(childTree); fillChildren(env, childTree, childNode.getFirstChild(), base); } }