If the value is null
, the column cannot be hidden via the sidebar menu.
+ *
+ * If the value is The algorithm assumes that all data rows have the same height and considers headers,
- * footers, and the horizontal scrollbar when the method is called. However, if data rows,
- * headers, or footers are inserted or removed after the initial calculation, the grid may not
- * automatically adjust the size of the grid to accommodate the changed number of rows.
+ *
+ * The algorithm assumes that all data rows have the same height and considers headers, footers,
+ * and the horizontal scrollbar when the method is called. However, if data rows, headers, or
+ * footers are inserted or removed after the initial calculation, the grid may not automatically
+ * adjust the size of the grid to accommodate the changed number of rows.
*
* @param rows The height in terms of number of rows displayed in Grid's body. If Grid doesn't
- * contain enough rows, white space is displayed instead.
+ * contain enough rows, white space is displayed instead.
* @throws IllegalArgumentException if {@code rows} is zero or less
* @throws IllegalArgumentException if {@code rows} is {@link Double#isInfinite(double) infinite}
* @throws IllegalArgumentException if {@code rows} is {@link Double#isNaN(double) NaN}
@@ -461,11 +464,12 @@ public static void setHeightByRows(Grid> grid, double rows) {
}
/**
- * Sets the number of rows that should be visible in Grid's body, while {@link #getHeightMode()}
- * is {@link HeightMode#ROW}.
+ * Sets the number of rows that should be visible in Grid's body, while
+ * {@link #getHeightMode(Grid)} is {@link HeightMode#ROW}.
*
- * If Grid is currently not in {@link HeightMode#ROW}, the given value is remembered, and
- * applied once the mode is applied. @See {@link #setHeightByRows(Grid, double)}
+ *
+ * If Grid is currently not in {@link HeightMode#ROW}, the given value is remembered, and applied
+ * once the mode is applied. @See {@link #setHeightByRows(Grid, double)}
*/
public static void setHeightByRows(Grid> grid, int rows) {
// this overload is a workaround for a lombok issue "bad type on operand stack"
@@ -474,11 +478,11 @@ public static void setHeightByRows(Grid> grid, int rows) {
}
/**
- * Gets the amount of rows in Grid's body that are shown, while {@link #getHeightMode()} is {@link
- * HeightMode#ROW}.
+ * Gets the amount of rows in Grid's body that are shown, while {@link #getHeightMode(Grid)} is
+ * {@link HeightMode#ROW}.
*
* @return the amount of rows that are being shown in Grid's body
- * @see #setHeightByRows(double)
+ * @see #setHeightByRows(Grid, double)
*/
public static double getHeightByRows(Grid> grid) {
return getHelper(grid).heightByRowsHelper.getHeightByRows();
@@ -487,11 +491,13 @@ public static double getHeightByRows(Grid> grid) {
/**
* Defines the mode in which the Grid's height is calculated.
*
- * If {@link HeightMode#CSS} is given, Grid will respect the values given via a {@code
+ *
+ * If {@link HeightMode#CSS} is given, Grid will respect the values given via a {@code
* setHeight}-method, and behave as a traditional Component.
*
- * If {@link HeightMode#ROW} is given, Grid will make sure that the body will display as many
- * rows as {@link #getHeightByRows()} defines.
+ *
+ * If {@link HeightMode#ROW} is given, Grid will make sure that the body will display as many rows
+ * as {@link #getHeightByRows(Grid)} defines.
*
* @param heightMode the mode in to which Grid should be set
*/
@@ -502,14 +508,15 @@ public static void setHeightMode(Grid> grid, HeightMode heightMode) {
/**
* Defines the mode in which the Grid's height is calculated.
*
- * If {@link HeightMode#CSS} is given, Grid will respect the CSS height as a traditional
+ *
+ * If {@link HeightMode#CSS} is given, Grid will respect the CSS height as a traditional
* Component.
*
- * If {@link HeightMode#ROW} is given, Grid will make sure that the body will display as many
- * rows as {@link #getHeightByRows()} defines.
+ *
+ * If {@link HeightMode#ROW} is given, Grid will make sure that the body will display as many rows
+ * as {@link #getHeightByRows(Grid)} defines.
*
- * @param heightMode the mode in to which Grid should be set
- * @return
+ * @return the mode in which the Grid is set
*/
public static HeightMode getHeightMode(Grid> grid) {
return getHelper(grid).heightByRowsHelper.getHeightMode();
@@ -542,7 +549,7 @@ public static
- * Only works when Grid uses {@link SelectionMode.MULTI} and the data provider supplies a count
+ * Only works when Grid uses {@link SelectionMode#MULTI} and the data provider supplies a count
* callback.
*
* Note: enabling the select all checkbox when grid uses a lazy data source could lead to
diff --git a/src/main/java/com/flowingcode/vaadin/addons/gridhelpers/HeightMode.java b/src/main/java/com/flowingcode/vaadin/addons/gridhelpers/HeightMode.java
index dde55dc..078b765 100644
--- a/src/main/java/com/flowingcode/vaadin/addons/gridhelpers/HeightMode.java
+++ b/src/main/java/com/flowingcode/vaadin/addons/gridhelpers/HeightMode.java
@@ -19,10 +19,12 @@
*/
package com.flowingcode.vaadin.addons.gridhelpers;
+import com.vaadin.flow.component.grid.Grid;
+
/**
* The modes for height calculation that are supported {@link GridHelper}.
*
- * @see GridHelper#setHeightMode(HeightMode)
+ * @see GridHelper#setHeightMode(Grid, HeightMode)
*/
public enum HeightMode {
/**
null
, the column cannot be hidden via the sidebar menu.
*
- * @param hidingToggleCaption the text to show in the column hiding toggle
+ * @param column the column for which the hiding toggle caption is set
+ * @param caption the text to show in the column hiding toggle
*/
public static