public void recursivelyClearOutlineItems() { item = null; if (loadedChildren) { int count = getChildCount(); for (int i = 0; i < count; i++) { OutlineItemTreeNode node = (OutlineItemTreeNode) getChildAt(i); node.recursivelyClearOutlineItems(); } } }
public NodeUserObject(PageTree pageTree, OutlineItemTreeNode outlineItemTreeNode) { super(outlineItemTreeNode); // append the destination page number if (outlineItemTreeNode.getOutlineItem().getDest() != null) { goToPage = pageTree.getPageNumber( outlineItemTreeNode.getOutlineItem().getDest().getPageReference()); } else if (outlineItemTreeNode.getOutlineItem().getAction() != null) { OutlineItem item = outlineItemTreeNode.getOutlineItem(); Destination dest; if (item.getAction() != null) { Action action = item.getAction(); if (action instanceof GoToAction) { dest = ((GoToAction) action).getDestination(); } else { Library library = action.getLibrary(); Hashtable entries = action.getEntries(); dest = new Destination(library, library.getObject(entries, "D")); } goToPage = pageTree.getPageNumber(dest.getPageReference()); } } // set title setText(outlineItemTreeNode.getOutlineItem().getTitle()); // setup not state. setLeafIcon("tree_document.gif"); setBranchContractedIcon("tree_document.gif"); setBranchExpandedIcon("tree_document.gif"); // is item a node or a leaf. if (outlineItemTreeNode.getOutlineItem().getSubItemCount() > 0) { setLeaf(false); } else { setLeaf(true); } }