/** * Returns whether given item has children. * * @param item * the item to test * @return {@code true} if item has children; {@code false} if not */ public boolean hasChildren(T item) { return mapper.hasChildren(item); }
/** * Expands the given item if it is collapsed and has children, and returns * whether this method expanded the item. * * @param item * the item to expand * @return {@code true} if this method expanded the item, {@code false} * otherwise */ private boolean doExpand(T item) { boolean expanded = false; if (!isExpanded(item) && hasChildren(item)) { expandedItemIds.add(getDataProvider().getId(item)); expanded = true; } return expanded; }