Class GridResponsiveStep<T>
java.lang.Object
com.flowingcode.vaadin.addons.gridhelpers.GridResponsiveStep<T>
- Type Parameters:
T- the data type for Grid
- All Implemented Interfaces:
Serializable
Class used in describing the responsive layouting behavior of a
Grid- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA registration object for removing or configuring aGridResponsiveSteplistener. -
Method Summary
Modifier and TypeMethodDescriptionaddListener(@NonNull SerializableConsumer<GridResponsiveStepEvent> listener) Adds a listener which is invoked when the layout changes because of grid resizing.intReturn the minimum width (in pixels) after which this responsive step is to be applied.hide(Grid.Column<?>... columnsToHide) Hide the given columns when this responsive step is applied.hide(List<Grid.Column<T>> columnsToHide) Hide the given columns when this responsive step is applied.hideAll()Hide all the grid columns when this responsive step is applied.voidremove()Remove this responsive step and update the Grid.setColumns(Grid.Column<?>... columnsToShow) Set the columns that should be visible when this responsive step is applied.setColumns(List<Grid.Column<T>> columnsToShow) Set the columns that should be visible when this responsive step is applied.<C extends Component>
GridResponsiveStep<T>setItemDetailsRenderer(@NonNull SerializableFunction<T, C> componentFunction) Set the renderer to use for displaying the item details rows when this responsive step is applied.setItemDetailsRenderer(Renderer<T> renderer) Set the renderer to use for displaying the item details rows when this responsive step is applied.show(Grid.Column<?>... columnsToShow) Show the given columns when this responsive step is applied.show(List<Grid.Column<T>> columnsToShow) Show the given columns when this responsive step is applied.showAll()Show all the grid columns when this responsive step is applied.
-
Method Details
-
getMinWidth
public int getMinWidth()Return the minimum width (in pixels) after which this responsive step is to be applied. -
setItemDetailsRenderer
Set the renderer to use for displaying the item details rows when this responsive step is applied.- Parameters:
renderer- the renderer to use for displaying item details rows,nullto use no detail renderer- Returns:
- the instance of GridResponsiveStep for chaining method calls
- See Also:
-
setItemDetailsRenderer
public <C extends Component> GridResponsiveStep<T> setItemDetailsRenderer(@NonNull @NonNull SerializableFunction<T, C> componentFunction) Set the renderer to use for displaying the item details rows when this responsive step is applied.- Type Parameters:
C- the type of component returned bycomponentFunction- Parameters:
componentFunction- the function to set item details with a Component- Returns:
- the instance of GridResponsiveStep for chaining method calls
- See Also:
-
setColumns
Set the columns that should be visible when this responsive step is applied.- Parameters:
columnsToShow- columns that should be visible- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
setColumns
Set the columns that should be visible when this responsive step is applied.- Parameters:
columnsToShow- columns that should be visible- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
show
Show the given columns when this responsive step is applied.- Parameters:
columnsToShow- columns to show- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
show
Show the given columns when this responsive step is applied.- Parameters:
columnsToShow- the columns to show- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
hide
Hide the given columns when this responsive step is applied.- Parameters:
columnsToHide- the columns to hide- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
hide
Hide the given columns when this responsive step is applied.- Parameters:
columnsToHide- the columns to hide- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
hideAll
Hide all the grid columns when this responsive step is applied.- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
showAll
Show all the grid columns when this responsive step is applied.- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
addListener
public GridResponsiveStep.GridResponsiveStepListenerRegistration addListener(@NonNull @NonNull SerializableConsumer<GridResponsiveStepEvent> listener) Adds a listener which is invoked when the layout changes because of grid resizing. By default, the listener will be "non-cummulative" (i.e. it will only be fired when the exact step is selected).- Parameters:
listener- to add- Returns:
- handle to unregister the listener or make it cummulative
- See Also:
-
remove
public void remove()Remove this responsive step and update the Grid.
-