Class TwinColumn<T>
java.lang.Object
com.flowingcode.vaadin.addons.twincolgrid.TwinColumn<T>
- Direct Known Subclasses:
FilterableTwinColumn
Fluent helper object that delegates setters on both columns.
-
Constructor Summary
Constructors -
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.<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.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
-
TwinColumn
public TwinColumn()
-
-
Method Details
-
setWidth
Sets the width of the columns as a CSS-string.- Parameters:
width- the width to set both columns to, as a CSS-string, notnull- Returns:
- this instance, for method chaining
- See Also:
-
setFlexGrow
Sets the flex grow ratio for the columns. When set to 0, column width is fixed.- Parameters:
flexGrow- the flex grow ratio- Returns:
- this instance, for method chaining
- See Also:
-
setAutoWidth
Enables or disables automatic width for the columns.- Parameters:
autoWidth- whether to enable or disable automatic width on both columns- Returns:
- this instance, for method chaining
- See Also:
-
setKey
Sets the user-defined identifier to map the columns.- Parameters:
key- the identifier key, can't benull- Returns:
- this instance, for method chaining
- See Also:
-
setComparator
Sets a comparator to use with in-memory sorting with both columns.- 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) Sets a comparator to use with in-memory sorting with both columns based on the return type of the givenValueProvider.- 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
Sets strings describing back end properties to be used when sorting the columns.- Parameters:
properties- the array of strings describing backend properties- Returns:
- this instance, for method chaining
- See Also:
-
setSortOrderProvider
Sets the sort orders when sorting the columns. The sort order provider is a function which providesQuerySortOrderobjects to describe how to sort by the columns.- Parameters:
provider- the function to use when generating sort orders with the given direction- Returns:
- this instance, for method chaining
- See Also:
-
setSortable
Sets whether the user can sort the columns or not.- Parameters:
sortable-trueif the columns can be sorted by the user;falseif not- Returns:
- this instance, for method chaining
- See Also:
-
setHeader
Sets a header text to both columns.- Parameters:
labelText- the text to be shown at the columns headers- Returns:
- this instance, for method chaining
- See Also:
-
setHeader
Sets a header component to both columns.- Parameters:
headerComponentSupplier- a supplier that instantiates the component to be used in the header of each column- Returns:
- this instance, for method chaining
- See Also:
-
setClassNameGenerator
Sets the function that is used for generating CSS class names for cells in both columns.- Parameters:
classNameGenerator- the class name generator to set, notnull- Returns:
- this instance, for method chaining
- Throws:
NullPointerException- ifclassNameGeneratorisnull- See Also:
-