From 223444ebc9ba8fb179df772864a012327ecf0cb9 Mon Sep 17 00:00:00 2001 From: Mikhail Buzuverov Date: Fri, 26 May 2017 10:56:24 +0500 Subject: Added constructor to Grid for compatibility with 8.0.7 (#9206) (#9209) Constructor Grid(Class, DataCommunicator) was added to 8.0.7 and ported to master to maintain backward compatibility. Also fixed javadocs of constructors Grid(DataCommunicator) and Grid(PropertySet, DataCommunicator) to reflect that constructors were backported to 8.0.x and available since 8.0.7 --- server/src/main/java/com/vaadin/ui/Grid.java | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'server/src') diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 4f4ef43647..3db529ddf5 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -2117,6 +2117,23 @@ public class Grid extends AbstractListing implements HasComponents, * @see #withPropertySet(PropertySet) */ public Grid(Class beanType) { + this(beanType, new DataCommunicator<>()); + } + + /** + * Creates a new grid that uses custom data communicator and provided bean type + * + * It uses reflection of the provided bean type to automatically set up an initial set of columns. + * All columns will be configured using the same {@link Object#toString()} renderer that is used + * by {@link #addColumn(ValueProvider)}. + * + * @param beanType + * the bean type to use, not null + * @param dataCommunicator + * the data communicator to use, notnull + * @since 8.0.6 + */ + protected Grid(Class beanType, DataCommunicator dataCommunicator) { this(BeanPropertySet.get(beanType)); this.beanType = beanType; } @@ -2129,7 +2146,7 @@ public class Grid extends AbstractListing implements HasComponents, * the custom data communicator to set * @see #Grid() * @see #Grid(PropertySet, DataCommunicator) - * @since 8.1 + * @since 8.0.6 */ protected Grid(DataCommunicator dataCommunicator) { this(new PropertySet() { @@ -2177,7 +2194,7 @@ public class Grid extends AbstractListing implements HasComponents, * the property set implementation to use, not null. * @param dataCommunicator * the data communicator to use, notnull - * @since 8.1 + * @since 8.0.6 */ protected Grid(PropertySet propertySet, DataCommunicator dataCommunicator) { -- cgit v1.2.3