diff options
author | Mikhail Buzuverov <star.guardian.mgn@gmail.com> | 2017-05-26 10:56:24 +0500 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2017-05-26 08:56:24 +0300 |
commit | 223444ebc9ba8fb179df772864a012327ecf0cb9 (patch) | |
tree | f4690ec62d5aec79ef52ead42d5053dc2ef28aa8 /server | |
parent | ef8542679a59832b796af94e93309e2b9b83345d (diff) | |
download | vaadin-framework-223444ebc9ba8fb179df772864a012327ecf0cb9.tar.gz vaadin-framework-223444ebc9ba8fb179df772864a012327ecf0cb9.zip |
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
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/Grid.java | 21 |
1 files changed, 19 insertions, 2 deletions
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<T> extends AbstractListing<T> implements HasComponents, * @see #withPropertySet(PropertySet) */ public Grid(Class<T> 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 <code>null</code> + * @param dataCommunicator + * the data communicator to use, not<code>null</code> + * @since 8.0.6 + */ + protected Grid(Class<T> beanType, DataCommunicator<T> dataCommunicator) { this(BeanPropertySet.get(beanType)); this.beanType = beanType; } @@ -2129,7 +2146,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * the custom data communicator to set * @see #Grid() * @see #Grid(PropertySet, DataCommunicator) - * @since 8.1 + * @since 8.0.6 */ protected Grid(DataCommunicator<T> dataCommunicator) { this(new PropertySet<T>() { @@ -2177,7 +2194,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * the property set implementation to use, not <code>null</code>. * @param dataCommunicator * the data communicator to use, not<code>null</code> - * @since 8.1 + * @since 8.0.6 */ protected Grid(PropertySet<T> propertySet, DataCommunicator<T> dataCommunicator) { |