diff options
author | Artur Signell <artur@vaadin.com> | 2014-08-08 16:01:30 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-08-21 05:37:44 +0000 |
commit | 8476b57ce2261313f47b21764ddc02cc128b2fd4 (patch) | |
tree | dfa2ded0e48cbed3a0b9611212c81c9bfbebf400 /server/src/com/vaadin/ui/GridLayout.java | |
parent | eb50df0edb0c6eb86620127f3aa99da557a02f2b (diff) | |
download | vaadin-framework-8476b57ce2261313f47b21764ddc02cc128b2fd4.tar.gz vaadin-framework-8476b57ce2261313f47b21764ddc02cc128b2fd4.zip |
Add option for collapsing empty rows/columns in GridLayout (#14392)
This reverts the new default behavior introduced in fix for #8855.
If you want empty rows/columns to be ignored when rendering,
use GridLayout.setHideEmptyRowsAndColumns(true)
Change-Id: I38a8717d79cec7739b649174654b615db9d8dc7e
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; + } } |