Class FilterableTwinColumn<T>
java.lang.Object
com.flowingcode.vaadin.addons.twincolgrid.TwinColumn<T>
com.flowingcode.vaadin.addons.twincolgrid.FilterableTwinColumn<T>
Fluent helper object that delegates setters on both columns.
-
Constructor Summary
ConstructorsConstructorDescriptionFilterableTwinColumn(Grid.Column<T> availableColumn, Grid.Column<T> selectionColumn) -
Method Summary
Modifier and TypeMethodDescriptionsetAutoWidth(boolean autoWidth) Enables or disables automatic width for the columns.setClassNameGenerator(SerializableFunction<T, String> classNameGenerator) Sets the function that is used for generating CSS class names for cells in both columns.setClearButtonVisible(boolean clearButtonVisible) Set tofalseto hide the clear button which clears the filter text field.<V extends Comparable<? super V>>
TwinColumn<T>setComparator(ValueProvider<T, V> keyExtractor) Sets a comparator to use with in-memory sorting with both columns based on the return type of the givenValueProvider.setComparator(Comparator<T> comparator) Sets a comparator to use with in-memory sorting with both columns.setFilterPlaceholder(String filterPlaceholder) Set the placeholder of the filter text field on both columns.setFlexGrow(int flexGrow) Sets the flex grow ratio for the columns.Sets a footer text to both columns.Sets a footer component to both columns.Sets a header text to both columns.Sets a header component to both columns.Sets the user-defined identifier to map the columns.setSortable(boolean sortable) Sets whether the user can sort the columns or not.setSortOrderProvider(SortOrderProvider provider) Sets the sort orders when sorting the columns.setSortProperty(String... properties) Sets strings describing back end properties to be used when sorting the columns.Sets the width of the columns as a CSS-string.
-
Constructor Details
-
FilterableTwinColumn
-
-
Method Details
-
setFilterPlaceholder
Set the placeholder of the filter text field on both columns.- See Also:
-
setClearButtonVisible
Set tofalseto hide the clear button which clears the filter text field.- See Also:
-
setWidth
Description copied from class:TwinColumnSets the width of the columns as a CSS-string.- Overrides:
setWidthin classTwinColumn<T>- Parameters:
width- the width to set both columns to, as a CSS-string, notnull- Returns:
- this instance, for method chaining
- See Also:
-
setFlexGrow
Description copied from class:TwinColumnSets the flex grow ratio for the columns. When set to 0, column width is fixed.- Overrides:
setFlexGrowin classTwinColumn<T>- Parameters:
flexGrow- the flex grow ratio- Returns:
- this instance, for method chaining
- See Also:
-
setAutoWidth
Description copied from class:TwinColumnEnables or disables automatic width for the columns.- Overrides:
setAutoWidthin classTwinColumn<T>- Parameters:
autoWidth- whether to enable or disable automatic width on both columns- Returns:
- this instance, for method chaining
- See Also:
-
setKey
Description copied from class:TwinColumnSets the user-defined identifier to map the columns.- Overrides:
setKeyin classTwinColumn<T>- Parameters:
key- the identifier key, can't benull- Returns:
- this instance, for method chaining
- See Also:
-
setComparator
Description copied from class:TwinColumnSets a comparator to use with in-memory sorting with both columns.- Overrides:
setComparatorin classTwinColumn<T>- Parameters:
comparator- the comparator to use when sorting data in both columns- Returns:
- this instance, for method chaining
- See Also:
-
setComparator
public <V extends Comparable<? super V>> TwinColumn<T> setComparator(ValueProvider<T, V> keyExtractor) Description copied from class:TwinColumnSets a comparator to use with in-memory sorting with both columns based on the return type of the givenValueProvider.- Overrides:
setComparatorin classTwinColumn<T>- Type Parameters:
V- the value of the column- Parameters:
keyExtractor- the value provider used to extract theComparablesort key- Returns:
- this instance, for method chaining
- See Also:
-
setSortProperty
Description copied from class:TwinColumnSets strings describing back end properties to be used when sorting the columns.- Overrides:
setSortPropertyin classTwinColumn<T>- Parameters:
properties- the array of strings describing backend properties- Returns:
- this instance, for method chaining
- See Also:
-
setSortOrderProvider
Description copied from class:TwinColumnSets the sort orders when sorting the columns. The sort order provider is a function which providesQuerySortOrderobjects to describe how to sort by the columns.- Overrides:
setSortOrderProviderin classTwinColumn<T>- Parameters:
provider- the function to use when generating sort orders with the given direction- Returns:
- this instance, for method chaining
- See Also:
-
setSortable
Description copied from class:TwinColumnSets whether the user can sort the columns or not.- Overrides:
setSortablein classTwinColumn<T>- Parameters:
sortable-trueif the columns can be sorted by the user;falseif not- Returns:
- this instance, for method chaining
- See Also:
-
setHeader
Description copied from class:TwinColumnSets a header text to both columns.- Overrides:
setHeaderin classTwinColumn<T>- Parameters:
labelText- the text to be shown at the columns headers- Returns:
- this instance, for method chaining
- See Also:
-
setHeader
Description copied from class:TwinColumnSets a header component to both columns.- Overrides:
setHeaderin classTwinColumn<T>- Parameters:
footerComponentSupplier- a supplier that instantiates the component to be used in the header of each column- Returns:
- this instance, for method chaining
- See Also:
-
setClassNameGenerator
public FilterableTwinColumn<T> setClassNameGenerator(SerializableFunction<T, String> classNameGenerator) Description copied from class:TwinColumnSets the function that is used for generating CSS class names for cells in both columns.- Overrides:
setClassNameGeneratorin classTwinColumn<T>- Parameters:
classNameGenerator- the class name generator to set, notnull- Returns:
- this instance, for method chaining
- See Also:
-