From 16b37b6011395b50710078d4693d58d1ce58f173 Mon Sep 17 00:00:00 2001 From: Aleksi Hietanen Date: Tue, 16 May 2017 13:13:34 +0300 Subject: [PATCH] Fix code review comments --- server/src/main/java/com/vaadin/ui/Grid.java | 4 ++++ .../src/main/java/com/vaadin/ui/TreeGrid.java | 19 ++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 24f9b9cddd..463e475a44 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -3935,6 +3935,8 @@ public class Grid extends AbstractListing implements HasComponents, * Each member in the list of value providers corresponds to a column in the * grid. * + * @since 8.1 + * * @param body * the element to read data from * @param providers @@ -3997,6 +3999,8 @@ public class Grid extends AbstractListing implements HasComponents, * {@link DesignContext#shouldWriteData(Component)} returns {@code true} for * the grid that is being written. * + * @since 8.1 + * * @param body * the body element to write the declarative representation of * data to diff --git a/server/src/main/java/com/vaadin/ui/TreeGrid.java b/server/src/main/java/com/vaadin/ui/TreeGrid.java index 54e8e10a6c..e526f3b7cd 100644 --- a/server/src/main/java/com/vaadin/ui/TreeGrid.java +++ b/server/src/main/java/com/vaadin/ui/TreeGrid.java @@ -93,7 +93,10 @@ public class TreeGrid extends Grid /** * Creates a new {@code TreeGrid} using the given - * {@code HierarchicalDataProvider}. + * {@code HierarchicalDataProvider}, without support for creating columns + * based on property names. Use an alternative constructor, such as + * {@link TreeGrid#TreeGrid(Class)}, to create a {@code TreeGrid} that + * automatically sets up columns based on the type of presented data. * * @param dataProvider * the data provider, not {@code null} @@ -104,7 +107,11 @@ public class TreeGrid extends Grid } /** - * Creates a {@code TreeGrid} using the given in-memory data. + * Creates a {@code TreeGrid} using the given in-memory data, without + * support for creating columns based on property names. Use an alternative + * constructor, such as {@link TreeGrid#TreeGrid(Class)}, to create a + * {@code TreeGrid} that automatically sets up columns based on the type of + * presented data. * * @see TreeData * @@ -117,8 +124,8 @@ public class TreeGrid extends Grid } /** - * Creates a grid using a custom {@link PropertySet} implementation and - * custom data communicator. + * Creates a {@code TreeGrid} using a custom {@link PropertySet} + * implementation and custom data communicator. *

* Property set is used for configuring the initial columns and resolving * property names for {@link #addColumn(String)} and @@ -305,9 +312,7 @@ public class TreeGrid extends Grid if (getColumn(id) == null) { throw new IllegalArgumentException("No column found for given id"); } - getColumn(id).setHidden(false); - getColumn(id).setHidable(false); - getState().hierarchyColumnId = getInternalIdForColumn(getColumn(id)); + setHierarchyColumn(getColumn(id)); } /** -- 2.39.5