summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-08-08 16:01:30 +0300
committerArtur Signell <artur@vaadin.com>2014-08-21 08:40:04 +0300
commit78d3a753ac456af17893218f473c4f871bf07f60 (patch)
tree71455d91a2c5e4c901290d061d0ce11c23d04489 /server/src/com/vaadin/ui
parent6fd430698596f7344e05f87ba503063100c5ff50 (diff)
downloadvaadin-framework-78d3a753ac456af17893218f473c4f871bf07f60.tar.gz
vaadin-framework-78d3a753ac456af17893218f473c4f871bf07f60.zip
Add option for collapsing empty rows/columns in GridLayout (#14392)7.3.0.rc1
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')
-rw-r--r--server/src/com/vaadin/ui/GridLayout.java29
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;
+ }
}