*/
private static void expandAll(final JTree tree, final TreePath parent, final boolean expand) {
// Traverse children
final TreeNode node = (TreeNode) parent.getLastPathComponent();
if (node.getChildCount() >= 0)
for (final Enumeration<?> e = node.children(); e.hasMoreElements();) {
final TreeNode n = (TreeNode) e.nextElement();
final TreePath path = parent.pathByAddingChild(n);
expandAll(tree, path, expand);
}
// Expansion or collapse must be done bottom-up