From f9a9f2c4be0e38d936acab88cba45799fa83ff4a Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Wed, 29 Mar 2017 11:18:07 +0300 Subject: Add Grid.setRowHeight() (#8935) Fixes #8667 --- server/src/main/java/com/vaadin/ui/Grid.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'server/src/main') 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 @@ -2737,6 +2737,30 @@ public class Grid extends AbstractListing implements HasComponents, return getState(false).heightMode; } + /** + * 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. + *

+ * 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 -- cgit v1.2.3