diff options
Diffstat (limited to 'server/src/com/vaadin/ui/GridLayout.java')
-rw-r--r-- | server/src/com/vaadin/ui/GridLayout.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/GridLayout.java b/server/src/com/vaadin/ui/GridLayout.java index 0c097abc83..0dd16a03e7 100644 --- a/server/src/com/vaadin/ui/GridLayout.java +++ b/server/src/com/vaadin/ui/GridLayout.java @@ -1256,4 +1256,33 @@ public class GridLayout extends AbstractLayout implements defaultComponentAlignment = defaultAlignment; } + /** + * Sets whether empty rows and columns should be considered as non-existent + * when rendering or not. If this is set to true then the spacing between + * multiple empty columns (or rows) will be collapsed. + * + * The default behavior is to consider all rows and columns as visible + * + * NOTE that this must be set before the initial rendering takes place. + * Updating this on the fly is not supported. + * + * @since 7.3 + * @param hideEmptyRowsAndColumns + * true to hide empty rows and columns, false to leave them as-is + */ + public void setHideEmptyRowsAndColumns(boolean hideEmptyRowsAndColumns) { + getState().hideEmptyRowsAndColumns = hideEmptyRowsAndColumns; + } + + /** + * Checks whether whether empty rows and columns should be considered as + * non-existent when rendering or not. + * + * @see #setHideEmptyRowsAndColumns(boolean) + * @since 7.3 + * @return true if empty rows and columns are hidden, false otherwise + */ + public boolean isHideEmptyRowsAndColumns() { + return getState(false).hideEmptyRowsAndColumns; + } } |