diff options
author | Aleksi Hietanen <aleksi@vaadin.com> | 2017-05-11 09:10:04 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-05-16 15:35:17 +0300 |
commit | f5004fe3ce3b979060499390000b47003b4671de (patch) | |
tree | 7445e735b0f56613d1d7b9b3fa6a9be962a3de1a /server/src/main/java/com/vaadin | |
parent | f4bbe480693918a9b67f09773b9de03de7b61bd8 (diff) | |
download | vaadin-framework-f5004fe3ce3b979060499390000b47003b4671de.tar.gz vaadin-framework-f5004fe3ce3b979060499390000b47003b4671de.zip |
Add javadocs to Grid#readData and writeData
Diffstat (limited to 'server/src/main/java/com/vaadin')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/Grid.java | 28 |
1 files changed, 28 insertions, 0 deletions
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<T> extends AbstractListing<T> 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<DeclarativeValueProvider<T>> providers) { getSelectionModel().deselectAll(); @@ -3977,6 +3991,20 @@ public class Grid<T> extends AbstractListing<T> 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)); |