From 7f537988d31b22ee40fb0ee4b55e5b29708259d4 Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Fri, 23 Jul 2021 15:41:25 +0300 Subject: Checkstyle fixes (#12347) - Added, completed, and corrected JavaDocs. - Added an assert to enforce a condition that has always been required. - Added default sections to switch blocks. - Added wildcards. - Deprecated unused methods and variables. - Removed inner assignments. - Removed unused private variables and calls that do nothing. - Updated deprecated calls to use currently recommended versions. - Updated warning suppressions. - ...and some auto-formatting. --- server/src/main/java/com/vaadin/ui/Grid.java | 22 ++++++++++++++++++++++ server/src/main/java/com/vaadin/ui/TreeGrid.java | 8 ++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 137f947401..0a13bab427 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -632,6 +632,14 @@ public class Grid extends AbstractListing implements HasComponents, return (AbstractGridExtensionState) super.getState(markAsDirty); } + /** + * Returns the internal id for given column. This id should not be + * confused with the user-defined identifier. + * + * @param column + * the column + * @return internal id of given column + */ protected String getInternalIdForColumn(Column column) { return getParent().getInternalIdForColumn(column); } @@ -2761,6 +2769,20 @@ public class Grid extends AbstractListing implements HasComponents, return beanType; } + /** + * Sends a {@link ColumnVisibilityChangeEvent} to all listeners. + * + * @param + * the column value type + * @param column + * the column that changed its visibility + * @param hidden + * {@code true} if the column was hidden, {@code false} if it + * became visible + * @param userOriginated + * {@code true} if the event was triggered by an UI interaction, + * {@code false} otherwise + */ public void fireColumnVisibilityChangeEvent(Column column, boolean hidden, boolean userOriginated) { fireEvent(new ColumnVisibilityChangeEvent(this, column, hidden, diff --git a/server/src/main/java/com/vaadin/ui/TreeGrid.java b/server/src/main/java/com/vaadin/ui/TreeGrid.java index 97200ab974..c94cd3a795 100644 --- a/server/src/main/java/com/vaadin/ui/TreeGrid.java +++ b/server/src/main/java/com/vaadin/ui/TreeGrid.java @@ -164,6 +164,8 @@ public class TreeGrid extends Grid * @see TreeGrid#TreeGrid() * @see TreeGrid#TreeGrid(Class) * + * @param + * the tree grid bean type * @param propertySet * the property set implementation to use, not {@code null} * @return a new tree grid using the provided property set, not {@code null} @@ -202,7 +204,7 @@ public class TreeGrid extends Grid /** * This method is inherited from Grid but should never be called directly - * with a TreeGrid + * with a TreeGrid. */ @Override @Deprecated @@ -212,7 +214,7 @@ public class TreeGrid extends Grid /** * This method is inherited from Grid but should never be called directly - * with a TreeGrid + * with a TreeGrid. */ @Deprecated @Override @@ -344,6 +346,7 @@ public class TreeGrid extends Grid * @param items * the items to expand */ + @SuppressWarnings("unchecked") public void expand(T... items) { expand(Arrays.asList(items)); } @@ -434,6 +437,7 @@ public class TreeGrid extends Grid * @param items * the collection of items to collapse */ + @SuppressWarnings("unchecked") public void collapse(T... items) { collapse(Arrays.asList(items)); } -- cgit v1.2.3