/** * Unload the tree item * <p>To load the tree item, with * {@link Tree#renderItem(Treeitem)}, {@link Tree#renderItem(Treeitem, Object)}, or {@link Tree#renderItems(java.util.Set)} * * @since 3.0.4 */ public void unload() { if (isLoaded()) { //Clean its children if (getTreechildren() != null) getTreechildren().getChildren().clear(); //Set the load status to unloaded setLoaded(false); //Change the "+/-" sign icon setOpen(false); } }
ti.getChildren().clear(); ti.setRendered(false); ti.setLoaded(false);
/** Note: it doesn't call render doCatch/doFinally */ private void renderItem0(Renderer renderer, Treeitem item, Object node) throws Throwable { if (item.isLoaded()) //all direct children are loaded return; /* * After modified the node in tree model, if node is leaf, * its treechildren is needed to be dropped. */ Treechildren tc = item.getTreechildren(); if (_model.isLeaf(node)) { if (tc != null) tc.detach(); //just in case //no children to render //Note item already rendered, so no need: //renderer.render(item, node); } else { if (tc != null) tc.getChildren().clear(); //just in case else { tc = new Treechildren(); tc.setParent(item); } renderChildren(renderer, tc, node); } Object v = item.getAttribute(Attributes.MODEL_RENDERAS); if (v != null) //a new item is created to replace the existent one (item = (Treeitem) v).setOpen(false); item.setLoaded(true); }
if (!item.isLoaded() && newItem.isOpen()) Tree.this.renderChildren(this, tc, node); newItem.setLoaded(item.isLoaded());
getChildren().clear(); setRendered(false); setLoaded(false); Events.postEvent(new PagingEvent("onPagingImpl", (Paging) tree.getPaginal(), activePage));