diff options
author | Henri Sara <henri.sara@gmail.com> | 2017-03-29 11:18:07 +0300 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2017-03-29 11:18:07 +0300 |
commit | f9a9f2c4be0e38d936acab88cba45799fa83ff4a (patch) | |
tree | 59d2d5bbeb39ce2c942981c112e9a4bd3c6fed8d /server/src/main | |
parent | 92ccddf4f2465dae1f43e6087ca25ae41cae637d (diff) | |
download | vaadin-framework-f9a9f2c4be0e38d936acab88cba45799fa83ff4a.tar.gz vaadin-framework-f9a9f2c4be0e38d936acab88cba45799fa83ff4a.zip |
Add Grid.setRowHeight() (#8935)
Fixes #8667
Diffstat (limited to 'server/src/main')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/Grid.java | 24 |
1 files changed, 24 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 6b1d5bcb79..872e14a44f 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -2738,6 +2738,30 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, } /** + * Sets the height of a row. If -1 (default), the row height is calculated + * based on the theme for an empty row before the Grid is displayed. + * <p> + * Note that all header, body and footer rows get the same height if + * explicitly set. In automatic mode, each section is calculated separately + * based on an empty row of that type. + * + * @param rowHeight + * The height of a row in pixels or -1 for automatic calculation + */ + public void setRowHeight(double rowHeight) { + getState().rowHeight = rowHeight; + } + + /** + * Returns the currently explicitly set row height or -1 if automatic. + * + * @return explicitly set row height in pixels or -1 if in automatic mode + */ + public double getRowHeight() { + return getState(false).rowHeight; + } + + /** * Sets the style generator that is used for generating class names for rows * in this grid. Returning null from the generator results in no custom * style name being set. |