private int getVisibleItemCount() { return _treechildren != null ? _treechildren.getVisibleItemCount() : 0; }
/** * Returns the number of visible descendant {@link Treechildren}. * Descendants include direct children, grand children and so on. * * @since 3.6.1 */ public int getVisibleItemCount() { return isVisible() ? 1 + (_open && _treechildren != null ? _treechildren.getVisibleItemCount() : 0) : 0; }
public void onChildAdded(Component child) { super.onChildAdded(child); if (_treechildren == child) addVisibleItemCount(_treechildren.getVisibleItemCount()); }
public void onChildAdded(Component child) { super.onChildAdded(child); if (child instanceof Treechildren) addVisibleItemCount(((Treechildren) child).getVisibleItemCount()); }
public void onChildRemoved(Component child) { if (child instanceof Treecols) { _treecols = null; } else if (child instanceof Treefoot) { _treefoot = null; } else if (child instanceof Treechildren) { _treechildren = null; _selItems.clear(); _sel = null; addVisibleItemCount(-((Treechildren) child).getVisibleItemCount()); } else if (_paging == child) { _paging = null; if (_pgi == child) _pgi = null; } super.onChildRemoved(child); }
public void onChildRemoved(Component child) { if (child instanceof Treerow) { _treerow = null; } else if (child instanceof Treechildren) { if (isOpen()) addVisibleItemCount(-_treechildren.getVisibleItemCount()); _treechildren = null; } super.onChildRemoved(child); }
private static boolean shallVisitTree(Tree tree, Component child) { final Treeitem item = (Treeitem) child; int count = item.isOpen() && item.getTreechildren() != null ? item.getTreechildren().getVisibleItemCount() : 0; Integer visited = (Integer) tree.getAttribute(Attributes.VISITED_ITEM_COUNT); final Paginal pgi = tree.getPaginal(); final int ofs = pgi.getActivePage() * pgi.getPageSize(); int visit = visited != null ? visited.intValue() + 1 : 1; boolean shoulbBeVisited = ofs < visit + count; if (visited == null) visited = new Integer(shoulbBeVisited ? 1 : count + 1); else visited = new Integer(visited.intValue() + (shoulbBeVisited ? 1 : count + 1)); Integer total = (Integer) tree.getAttribute(Attributes.VISITED_ITEM_TOTAL); if (total == null) total = new Integer(count + 1); else total = new Integer(total.intValue() + count + 1); tree.setAttribute(Attributes.VISITED_ITEM_COUNT, visited); tree.setAttribute(Attributes.VISITED_ITEM_TOTAL, total); return shoulbBeVisited; }
Treechildren chdrn = item.getTreechildren(); if (inclusive && item.isOpen() && chdrn != null) { count += chdrn.getVisibleItemCount();
/** Sets whether this container is open. */ public void setOpen(boolean open) { if (_open != open) { _open = open; //Note: _treerow might not be ready yet because it might be //initialized before creating child components (for ZK pages) smartUpdate("open", _open); //If the item is open, its tree has model and not rendered, render the item if (_treechildren != null) addVisibleItemCount((_open ? 1 : -1) * _treechildren.getVisibleItemCount()); Tree tree = getTree(); if (tree != null && tree.getModel() != null) { if (_open && !isLoaded()) tree.renderItem(this); } } }
public boolean setVisible(boolean visible) { if (isVisible() != visible) { smartUpdate("visible", visible); int count = isOpen() && _treechildren != null ? _treechildren.getVisibleItemCount() + 1 : 1; if (visible) { boolean result = super.setVisible(visible); addVisibleItemCount(count); return result; } else { addVisibleItemCount(-count); return super.setVisible(visible); } } return visible; }
if (item.isRealVisible()) { int count = item.isOpen() && item.getTreechildren() != null ? item.getTreechildren().getVisibleItemCount() : 0; boolean shoulbBeVisited = data[1] < data[2] + 1 + count; data[2] += (shoulbBeVisited ? 1 : count + 1);
addVisibleItemCount(_treechildren.getVisibleItemCount()); else { addVisibleItemCount(-_treechildren.getVisibleItemCount());