|
20 | 20 | package com.flowingcode.vaadin.addons.twincolgrid; |
21 | 21 |
|
22 | 22 | import com.vaadin.flow.component.Component; |
| 23 | +import com.vaadin.flow.component.grid.Grid; |
23 | 24 | import com.vaadin.flow.component.grid.Grid.Column; |
24 | 25 | import com.vaadin.flow.component.grid.SortOrderProvider; |
25 | 26 | import com.vaadin.flow.data.provider.QuerySortOrder; |
@@ -240,17 +241,21 @@ public TwinColumn<T> setFooter(Supplier<Component> footerComponentSupplier) { |
240 | 241 | } |
241 | 242 |
|
242 | 243 | /** |
243 | | - * Sets the function that is used for generating CSS class names for cells in both columns. |
| 244 | + * Sets the function that is used for generating CSS part names for cells in both columns. |
| 245 | + * Returning {@code null} from the generator results in no custom part name being set. Multiple |
| 246 | + * part names can be returned from the generator as space-separated. |
| 247 | + * <p> |
| 248 | + * If {@link Grid#setPartNameGenerator(SerializableFunction)} is used together with this method, |
| 249 | + * resulting part names from both methods will be effective. |
244 | 250 | * |
245 | | - * @see Column#setClassNameGenerator(SerializableFunction) |
246 | | - * |
247 | | - * @param classNameGenerator the class name generator to set, not {@code null} |
| 251 | + * @param partNameGenerator the part name generator to set, not {@code null} |
248 | 252 | * @return this instance, for method chaining |
249 | | - * @throws NullPointerException if {@code classNameGenerator} is {@code null} |
| 253 | + * @throws NullPointerException if {@code partNameGenerator} is {@code null} |
| 254 | + * @see Column#setPartNameGenerator(SerializableFunction) |
250 | 255 | */ |
251 | | - public TwinColumn<T> setClassNameGenerator(SerializableFunction<T, String> classNameGenerator) { |
252 | | - availableColumn.setClassNameGenerator(classNameGenerator); |
253 | | - selectionColumn.setClassNameGenerator(classNameGenerator); |
| 256 | + public TwinColumn<T> setPartNameGenerator(SerializableFunction<T, String> partNameGenerator) { |
| 257 | + availableColumn.setPartNameGenerator(partNameGenerator); |
| 258 | + selectionColumn.setPartNameGenerator(partNameGenerator); |
254 | 259 | return this; |
255 | 260 | } |
256 | 261 |
|
|
0 commit comments