diff options
author | Aleksi Hietanen <aleksi@vaadin.com> | 2017-05-03 13:36:34 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-05-03 13:36:34 +0300 |
commit | 8a77872050b8b51013261458d2c766dc93ff6c11 (patch) | |
tree | 6efbffe9d28a0a3cd9a5f1d28d84235e3c039195 | |
parent | c48fd3d872df347550fd9f2754713c06bb62b2cd (diff) | |
download | vaadin-framework-8a77872050b8b51013261458d2c766dc93ff6c11.tar.gz vaadin-framework-8a77872050b8b51013261458d2c766dc93ff6c11.zip |
Add additional overrides to Tree (#9225)
-rw-r--r-- | server/src/main/java/com/vaadin/ui/Tree.java | 99 |
1 files changed, 85 insertions, 14 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Tree.java b/server/src/main/java/com/vaadin/ui/Tree.java index eb1af8443b..ba249a7169 100644 --- a/server/src/main/java/com/vaadin/ui/Tree.java +++ b/server/src/main/java/com/vaadin/ui/Tree.java @@ -135,7 +135,7 @@ public class Tree<T> extends Composite implements HasDataProvider<T> { treeGrid.setPrimaryStyleName("v-newtree"); setWidth("100%"); - setHeightUndefined(); + treeGrid.setHeightUndefined(); treeGrid.setHeightMode(HeightMode.UNDEFINED); treeGrid.addExpandListener(e -> fireExpandEvent(e.getExpandedItem(), @@ -221,28 +221,53 @@ public class Tree<T> extends Composite implements HasDataProvider<T> { } /** - * Expands the given item. + * Expands the given items. * <p> - * If the item is currently expanded, does nothing. If the item does not - * have any children, does nothing. + * If an item is currently expanded, does nothing. If an item does not have + * any children, does nothing. * - * @param item - * the item to expand + * @param items + * the items to expand */ - public void expand(T item) { - treeGrid.expand(item); + public void expand(T... items) { + treeGrid.expand(items); } /** - * Collapses the given item. + * Expands the given items. * <p> - * If the item is already collapsed, does nothing. + * If an item is currently expanded, does nothing. If an item does not have + * any children, does nothing. * - * @param item - * the item to collapse + * @param items + * the items to expand + */ + public void expand(Collection<T> items) { + treeGrid.expand(items); + } + + /** + * Collapse the given items. + * <p> + * For items that are already collapsed, does nothing. + * + * @param items + * the collection of items to collapse + */ + public void collapse(T... items) { + treeGrid.collapse(items); + } + + /** + * Collapse the given items. + * <p> + * For items that are already collapsed, does nothing. + * + * @param items + * the collection of items to collapse */ - public void collapse(T item) { - treeGrid.collapse(item); + public void collapse(Collection<T> items) { + treeGrid.collapse(items); } /** @@ -363,4 +388,50 @@ public class Tree<T> extends Composite implements HasDataProvider<T> { treeGrid.getDataCommunicator().reset(); } + /** + * @deprecated This component's height is always set to be undefined. + * Calling this method will have no effect. + */ + @Override + @Deprecated + public void setHeight(String height) { + } + + /** + * @deprecated This component's height is always set to be undefined. + * Calling this method will have no effect. + */ + @Override + @Deprecated + public void setHeight(float height, Unit unit) { + } + + /** + * @deprecated This component's height is always set to be undefined. + * Calling this method will have no effect. + */ + @Override + @Deprecated + public void setHeightUndefined() { + } + + @Override + public void setCaption(String caption) { + treeGrid.setCaption(caption); + } + + @Override + public String getCaption() { + return treeGrid.getCaption(); + } + + @Override + public void setIcon(Resource icon) { + treeGrid.setIcon(icon); + } + + @Override + public Resource getIcon() { + return treeGrid.getIcon(); + } } |