aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin/ui/Tree.java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/Tree.java')
-rw-r--r--server/src/main/java/com/vaadin/ui/Tree.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Tree.java b/server/src/main/java/com/vaadin/ui/Tree.java
index 4e96f4a3e4..bebe6972b5 100644
--- a/server/src/main/java/com/vaadin/ui/Tree.java
+++ b/server/src/main/java/com/vaadin/ui/Tree.java
@@ -442,6 +442,25 @@ public class Tree<T> extends Composite
}
/**
+ * Expands the given items and their children recursively until the given
+ * depth.
+ * <p>
+ * {@code depth} describes the maximum distance between a given item and its
+ * descendant, meaning that {@code expandRecursively(items, 0)} expands only
+ * the given items while {@code expandRecursively(items, 2)} expands the
+ * given items as well as their children and grandchildren.
+ *
+ * @param items
+ * the items to expand recursively
+ * @param depth
+ * the maximum depth of recursion
+ * @since
+ */
+ public void expandRecursively(Collection<T> items, int depth) {
+ treeGrid.expandRecursively(items, depth);
+ }
+
+ /**
* Collapse the given items.
* <p>
* For items that are already collapsed, does nothing.
@@ -466,6 +485,25 @@ public class Tree<T> extends Composite
}
/**
+ * Collapse the given items and their children recursively until the given
+ * depth.
+ * <p>
+ * {@code depth} describes the maximum distance between a given item and its
+ * descendant, meaning that {@code collapseRecursively(items, 0)} collapses
+ * only the given items while {@code collapseRecursively(items, 2)}
+ * collapses the given items as well as their children and grandchildren.
+ *
+ * @param items
+ * the items to expand recursively
+ * @param depth
+ * the maximum depth of recursion
+ * @since
+ */
+ public void collapseRecursively(Collection<T> items, int depth) {
+ treeGrid.collapseRecursively(items, depth);
+ }
+
+ /**
* Returns whether a given item is expanded or collapsed.
*
* @param item