From f5004fe3ce3b979060499390000b47003b4671de Mon Sep 17 00:00:00 2001 From: Aleksi Hietanen Date: Thu, 11 May 2017 09:10:04 +0300 Subject: Add javadocs to Grid#readData and writeData --- server/src/main/java/com/vaadin/ui/Grid.java | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'server/src/main/java/com/vaadin') diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 9300b445e8..24f9b9cddd 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -3929,6 +3929,20 @@ public class Grid extends AbstractListing implements HasComponents, } } + /** + * Reads the declarative representation of a grid's data from the given + * element and stores it in the given {@link DeclarativeValueProvider}s. + * Each member in the list of value providers corresponds to a column in the + * grid. + * + * @param body + * the element to read data from + * @param providers + * list of {@link DeclarativeValueProvider}s to store the data of + * each column to + * + * @since 8.1 + */ protected void readData(Element body, List> providers) { getSelectionModel().deselectAll(); @@ -3977,6 +3991,20 @@ public class Grid extends AbstractListing implements HasComponents, } } + /** + * Writes the data contained in this grid. Used when serializing a grid to + * its declarative representation, if + * {@link DesignContext#shouldWriteData(Component)} returns {@code true} for + * the grid that is being written. + * + * @param body + * the body element to write the declarative representation of + * data to + * @param designContext + * the design context + * + * @since 8.1 + */ protected void writeData(Element body, DesignContext designContext) { getDataProvider().fetch(new Query<>()) .forEach(item -> writeRow(body, item, designContext)); -- cgit v1.2.3