summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-08-21 12:01:32 +0300
committerAleksi Hietanen <aleksi@vaadin.com>2017-08-21 12:01:32 +0300
commit5ef925daa91b1253f170f244e2a992f4f92979e1 (patch)
treed45284ba338b71140bf1be522c8782fb16c9aca9 /server
parent554f39ad0455623fbb1befc4444e67c809de5c0a (diff)
downloadvaadin-framework-5ef925daa91b1253f170f244e2a992f4f92979e1.tar.gz
vaadin-framework-5ef925daa91b1253f170f244e2a992f4f92979e1.zip
Add item descriptions to Tree (#9840)
Fixes #9803
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/com/vaadin/ui/Tree.java25
1 files changed, 25 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 aeb2dcfb6d..77d7d2300a 100644
--- a/server/src/main/java/com/vaadin/ui/Tree.java
+++ b/server/src/main/java/com/vaadin/ui/Tree.java
@@ -49,6 +49,7 @@ import com.vaadin.shared.ui.grid.HeightMode;
import com.vaadin.shared.ui.tree.TreeMultiSelectionModelState;
import com.vaadin.shared.ui.tree.TreeRendererState;
import com.vaadin.ui.Grid.SelectionMode;
+import com.vaadin.ui.components.grid.DescriptionGenerator;
import com.vaadin.ui.components.grid.MultiSelectionModelImpl;
import com.vaadin.ui.renderers.AbstractRenderer;
import com.vaadin.util.ReflectTools;
@@ -596,6 +597,20 @@ public class Tree<T> extends Composite
}
/**
+ * Sets the description generator that is used for generating tooltip
+ * descriptions for items.
+ *
+ * @since
+ * @param descriptionGenerator
+ * the item description generator to set, or <code>null</code> to
+ * remove a previously set generator
+ */
+ public void setItemDescriptionGenerator(
+ DescriptionGenerator<T> descriptionGenerator) {
+ treeGrid.setDescriptionGenerator(descriptionGenerator);
+ }
+
+ /**
* Gets the item caption generator.
*
* @return the item caption generator
@@ -636,6 +651,16 @@ public class Tree<T> extends Composite
}
/**
+ * Gets the item description generator.
+ *
+ * @since
+ * @return the item description generator
+ */
+ public DescriptionGenerator<T> getItemDescriptionGenerator() {
+ return treeGrid.getDescriptionGenerator();
+ }
+
+ /**
* Adds an item click listener. The listener is called when an item of this
* {@code Tree} is clicked.
*