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
public class GridResponsiveStep<T> extends Object implements Serializable
Class used in describing the responsive layouting behavior of aGrid
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
GridResponsiveStep.GridResponsiveStepListenerRegistration
A registration object for removing or configuring aGridResponsiveStep
listener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GridResponsiveStep.GridResponsiveStepListenerRegistration
addListener(@NonNull SerializableConsumer<GridResponsiveStepEvent> listener)
Adds a listener which is invoked when the layout changes because of grid resizing.int
getMinWidth()
Return the minimum width (in pixels) after which this responsive step is to be applied.GridResponsiveStep<T>
hide(Grid.Column<?>... columnsToHide)
Hide the given columns when this responsive step is applied.GridResponsiveStep<T>
hide(List<Grid.Column<T>> columnsToHide)
Hide the given columns when this responsive step is applied.GridResponsiveStep<T>
hideAll()
Hide all the grid columns when this responsive step is applied.void
remove()
Remove this responsive step and update the Grid.GridResponsiveStep<T>
setColumns(Grid.Column<?>... columnsToShow)
Set the columns that should be visible when this responsive step is applied.GridResponsiveStep<T>
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.GridResponsiveStep<T>
setItemDetailsRenderer(Renderer<T> renderer)
Set the renderer to use for displaying the item details rows when this responsive step is applied.GridResponsiveStep<T>
show(Grid.Column<?>... columnsToShow)
Show the given columns when this responsive step is applied.GridResponsiveStep<T>
show(List<Grid.Column<T>> columnsToShow)
Show the given columns when this responsive step is applied.GridResponsiveStep<T>
showAll()
Show all the grid columns when this responsive step is applied.
-
-
-
Method Detail
-
getMinWidth
public int getMinWidth()
Return the minimum width (in pixels) after which this responsive step is to be applied.
-
setItemDetailsRenderer
public GridResponsiveStep<T> setItemDetailsRenderer(Renderer<T> renderer)
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,null
to use no detail renderer- Returns:
- the instance of GridResponsiveStep for chaining method calls
- See Also:
Grid.setItemDetailsRenderer(Renderer)
-
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:
Grid.setItemDetailsRenderer(Renderer)
-
setColumns
public GridResponsiveStep<T> setColumns(Grid.Column<?>... columnsToShow)
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
public GridResponsiveStep<T> setColumns(List<Grid.Column<T>> columnsToShow)
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
public GridResponsiveStep<T> show(Grid.Column<?>... columnsToShow)
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
public GridResponsiveStep<T> show(List<Grid.Column<T>> columnsToShow)
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
public GridResponsiveStep<T> hide(Grid.Column<?>... columnsToHide)
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
public GridResponsiveStep<T> hide(List<Grid.Column<T>> columnsToHide)
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
public GridResponsiveStep<T> hideAll()
Hide all the grid columns when this responsive step is applied.- Returns:
- the instance of GridResponsiveStep for chaining method calls
-
showAll
public GridResponsiveStep<T> 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:
GridResponsiveStep.GridResponsiveStepListenerRegistration.cummulative()
-
remove
public void remove()
Remove this responsive step and update the Grid.
-
-