T - Item typeP - Item property typeL - Item listing typeC - Concrete configurator typepublic interface ItemListingConfigurator<T,P,L extends ItemListing<T,P>,C extends ItemListingConfigurator<T,P,L,C>> extends ComponentConfigurator<C>, HasSizeConfigurator<C>, HasStyleConfigurator<C>, HasEnabledConfigurator<C>, FocusableConfigurator<com.vaadin.flow.component.Component,C>, HasThemeVariantConfigurator<com.vaadin.flow.component.grid.GridVariant,C>, InputGroupConfigurator<P,T,ItemListing.EditorComponentGroup<P,T>,C>
ItemListing configurator.| Modifier and Type | Interface and Description |
|---|---|
static class |
ItemListingConfigurator.ColumnAlignment
Enumeration of column text alignments.
|
static interface |
ItemListingConfigurator.EditableItemListingRow<P>
An editable
ItemListing section row handler. |
static interface |
ItemListingConfigurator.EditableItemListingSection<P>
ItemListing section handler for header and footer configuration. |
static interface |
ItemListingConfigurator.ItemListingColumnBuilder<T,P,L extends ItemListing<T,P>,B extends ItemListingConfigurator<T,P,L,B>>
ItemListing column builder.
|
static interface |
ItemListingConfigurator.ItemListingColumnConfigurator<T,P,C extends ItemListingConfigurator.ItemListingColumnConfigurator<T,P,C>>
ItemListing column configurator.
|
static interface |
ItemListingConfigurator.ItemListingContextMenuBuilder<T,P,L extends ItemListing<T,P>,B extends ItemListingConfigurator<T,P,L,B>>
ItemListing context menu builder. |
ComponentConfigurator.BaseComponentConfiguratorInputGroupConfigurator.BeanInputGroupConfigurator<T,G extends BoundComponentGroup<String,Input<?>>,C extends InputGroupConfigurator.BeanInputGroupConfigurator<T,G,C>>, InputGroupConfigurator.PropertySetInputGroupConfigurator<G extends BoundComponentGroup<com.holonplatform.core.property.Property<?>,Input<?>>,C extends InputGroupConfigurator.PropertySetInputGroupConfigurator<G,C>>FULL_SIZE| Modifier and Type | Method and Description |
|---|---|
C |
alignment(P property,
ItemListingConfigurator.ColumnAlignment alignment)
Sets the text alignment for the column which corresponds to given property.
|
C |
columnReorderingAllowed(boolean columnReorderingAllowed)
Sets whether column reordering is allowed or not.
|
default <R extends com.vaadin.flow.component.Component> |
componentRenderer(P property,
Function<T,R> renderer)
Render the column which corresponds to given property as a
Component, using given function to provide the
component for each listing item. |
ItemListingConfigurator.ItemListingContextMenuBuilder<T,P,L,C> |
contextMenu()
Get a
ItemListingConfigurator.ItemListingContextMenuBuilder to configure and add a context menu to show for each listing item. |
C |
displayAfter(P property,
P afterProperty)
Configure the column represented by given
property id to be displayed after the column which
corresponds to the id specified by the given afterProperty. |
C |
displayAsFirst(P property)
Configure the column represented by given
property to be displayed before any other listing column
by default. |
C |
displayAsLast(P property)
Configure the column represented by given
property to be displayed after any other listing column by
default. |
C |
displayBefore(P property,
P beforeProperty)
Configure the column represented by given
property id to be displayed before the column which
corresponds to the id specified by the given beforeProperty. |
default C |
editable()
Set the listing as editable.
|
C |
editable(boolean editable)
Set whether the listing is editable.
|
C |
editorBuffered(boolean buffered)
Set whether the editor is in buffered mode.
|
default C |
editorComponent(P property,
com.vaadin.flow.component.Component editorComponent)
Set the
Component to display when the column bound to given property is in editing mode. |
C |
editorComponent(P property,
Function<T,? extends com.vaadin.flow.component.Component> editorComponentProvider)
Set the
Component to display when the column bound to given property is in editing mode. |
C |
expand(P property)
Expand the column which corresponds to given property, taking all the available space.
|
C |
flexGrow(P property,
int flexGrow)
Sets the flex grow ratio for the column which corresponds to given property.
|
C |
footer(Consumer<ItemListingConfigurator.EditableItemListingSection<P>> footerConfigurator)
Provide a
Consumer to configure the item listing footer section, using the ItemListing.ItemListingSection
API. |
C |
footer(P property,
com.holonplatform.core.i18n.Localizable footer)
Set the footer text for the column which corresponds to given property.
|
default C |
footer(P property,
String footer)
Set the footer text for the column which corresponds to given property.
|
default C |
footer(P property,
String defaultFooter,
String footerMessageCode)
Set the footer text for the column which corresponds to given property.
|
C |
footerComponent(P property,
com.vaadin.flow.component.Component footer)
Set the
Component to use as footer for the column which corresponds to given property. |
C |
frozen(boolean frozen)
Set whether the listing is frozen.
|
C |
frozen(P property,
boolean frozen)
Set whether the column which corresponds to given property is frozen.
|
C |
frozenColumns(int frozenColumnsCount)
Sets the number of frozen columns in this listing.
|
C |
header(Consumer<ItemListingConfigurator.EditableItemListingSection<P>> headerConfigurator)
Provide a
Consumer to configure the item listing header section, using the ItemListing.ItemListingSection
API. |
C |
header(P property,
com.holonplatform.core.i18n.Localizable header)
Set the header text for the column which corresponds to given property.
|
default C |
header(P property,
String header)
Set the header text for the column which corresponds to given property.
|
default C |
header(P property,
String defaultHeader,
String headerMessageCode)
Set the header text for the column which corresponds to given property.
|
C |
headerComponent(P property,
com.vaadin.flow.component.Component header)
Set the
Component to use as header for the column which corresponds to given property. |
C |
heightByRows(boolean heightByRows)
If
true, the listing's height is defined by the number of its rows. |
default C |
hidden(P property)
Set the column which corresponds to given property as hidden.
|
default C |
itemDetailsComponent(Function<T,com.vaadin.flow.component.Component> componentProvider)
Set the function to use for displaying the item details rows as a
Component. |
C |
itemDetailsRenderer(com.vaadin.flow.data.renderer.Renderer<T> renderer)
Set the renderer to use for displaying the item details rows.
|
default C |
itemDetailsText(Function<T,String> textProvider)
Set the function to use for displaying the item details rows as a text.
|
C |
itemDetailsVisibleOnClick(boolean detailsVisibleOnClick)
Sets whether the item details can be opened and closed by clicking the rows or not.
|
default C |
multiSelect()
Set the listing selection mode as
Selectable.SelectionMode.MULTI. |
C |
multiSort(boolean multiSort)
Sets whether multiple column sorting is enabled on the client-side.
|
default C |
notSelectable()
Set the listing selection mode as
Selectable.SelectionMode.NONE. |
C |
pageSize(int pageSize)
Sets the page size, which is the number of items fetched at a time from the data source.
|
C |
readOnly(P property,
boolean readOnly)
Set whether the column which corresponds to given property is read-only.
|
C |
renderer(P property,
com.vaadin.flow.data.renderer.Renderer<T> renderer)
Sets the
Renderer to use for the column which corresponds to given property. |
C |
resizable(boolean resizable)
Set whether all the item listing columns are user-resizable.
|
C |
resizable(P property,
boolean resizable)
Set whether the column which corresponds to given property is user-resizable.
|
C |
selectionMode(Selectable.SelectionMode selectionMode)
Set the listing selection mode.
|
default C |
singleSelect()
Set the listing selection mode as
Selectable.SelectionMode.SINGLE. |
C |
sortable(boolean sortable)
Set whether all the item listing columns are user-sortable.
|
C |
sortable(P property,
boolean sortable)
Set whether the column which corresponds to given property is user-sortable.
|
C |
sortComparator(P property,
Comparator<T> comparator)
Sets comparator to use with in-memory sorting for the column which corresponds to given property.
|
C |
sortProvider(P property,
Function<com.holonplatform.core.query.QuerySort.SortDirection,Stream<ItemSort<P>>> sortProvider)
Set the function to use to obtain the
ItemSorts to use when the column which corresponds to given
property is user-sorted. |
C |
sortUsing(P property,
List<P> sortProperties)
Set the properties to use to implement the sort logic to apply when the column which corresponds to given
property is user-sorted.
|
default C |
sortUsing(P property,
P... sortProperties)
Set the properties to use to implement the sort logic to apply when the column which corresponds to given
property is user-sorted.
|
C |
styleNameGenerator(Function<T,String> styleNameGenerator)
Sets the function that is used for generating CSS style class names for rows in this listing.
|
C |
styleNameGenerator(P property,
Function<T,String> styleNameGenerator)
Set the CSS style class name generator to use for the column which corresponds to given property.
|
C |
valueProvider(P property,
com.vaadin.flow.function.ValueProvider<T,String> valueProvider)
Sets the
ValueProvider to use to obtain the text to display in the column which corresponds to given
property. |
C |
verticalScrollingEnabled(boolean enabled)
Enables or disables the vertical scrolling on the Grid web component.
|
C |
visible(P property,
boolean visible)
Set whether the column which corresponds to given property is visible.
|
C |
visibleColumns(List<? extends P> visibleColumns)
Set the visible columns list, using the item properties as column reference.
|
default C |
visibleColumns(P... visibleColumns)
Set the visible columns list, using the item properties as column reference.
|
C |
width(P property,
String width)
Sets the width of the column which corresponds to given property as a CSS-string.
|
<X> ItemListingConfigurator.ItemListingColumnBuilder<T,P,L,C> |
withColumn(com.vaadin.flow.function.ValueProvider<T,X> valueProvider)
Add a virtual column which contents will be rendered using given
valueProvider. |
ItemListingConfigurator.ItemListingColumnBuilder<T,P,L,C> |
withComponentColumn(com.vaadin.flow.function.ValueProvider<T,com.vaadin.flow.component.Component> valueProvider)
Add a column which contents will be rendered as a
Component using given valueProvider. |
C |
withEditorCancelListener(com.vaadin.flow.component.grid.editor.EditorCancelListener<T> listener)
Adds an item editor listener for editor
cancel events. |
C |
withEditorCloseListener(com.vaadin.flow.component.grid.editor.EditorCloseListener<T> listener)
Adds an item editor save listener for editor
close events. |
C |
withEditorOpenListener(com.vaadin.flow.component.grid.editor.EditorOpenListener<T> listener)
Adds an item editor save listener for editor
open events. |
C |
withEditorSaveListener(com.vaadin.flow.component.grid.editor.EditorSaveListener<T> listener)
Adds an item editor listener for editor
save events. |
C |
withItemClickListener(ClickEventListener<L,ItemClickEvent<L,T>> listener)
Adds a listener that gets notified when user clicks on an item row.
|
C |
withItemRefreshListener(ItemEventListener<L,T,ItemEvent<L,T>> listener)
Adds a listener that gets notified when the item listing data is refreshed.
|
C |
withSelectionListener(Selectable.SelectionListener<T> selectionListener)
Add a
Selectable.SelectionListener to listen to items selection changes. |
elementConfiguration, hidden, id, visible, withAttachListener, withDetachListenerwithEventListener, withEventListener, withThemeNamefullHeight, fullSize, fullWidth, height, height, heightUndefined, maxHeight, maxWidth, minHeight, minWidth, sizeUndefined, width, width, widthUndefinedstyleName, styleNamesdisabled, enabledtabIndex, withBlurListener, withFocusListener, withFocusShortcut, withFocusShortcutKeywithThemeVariantsenableRefreshOnValueChange, groupValidationStatusHandler, required, required, required, required, validationStatusHandler, validationStatusHandler, validationStatusLabel, withPostProcessor, withValidatorusePropertyRendererRegistry, withValueChangeListenerC displayAsFirst(P property)
property to be displayed before any other listing column
by default.property - The property which represents the column to display as first (not null)C displayAsLast(P property)
property to be displayed after any other listing column by
default.property - The property which represents the column to display as last (not null)C displayBefore(P property, P beforeProperty)
property id to be displayed before the column which
corresponds to the id specified by the given beforeProperty.property - Property which represents the column to display before the other property (not null)beforeProperty - Property which represents the column before which the first property has to be displayed
(not null)C displayAfter(P property, P afterProperty)
property id to be displayed after the column which
corresponds to the id specified by the given afterProperty.property - Property which represents the column to display after the other property (not null)afterProperty - Property which represents the column after which the first property has to be displayed (not
null)<X> ItemListingConfigurator.ItemListingColumnBuilder<T,P,L,C> withColumn(com.vaadin.flow.function.ValueProvider<T,X> valueProvider)
valueProvider.X - Column value typevalueProvider - The value provider to use to provide the column value, using the current row item instance
(not null)ItemListingConfigurator.ItemListingColumnBuilder which allow further column configuration and provides the
ItemListingConfigurator.ItemListingColumnBuilder.add() method to add the column to the listingItemListingConfigurator.ItemListingColumnBuilder<T,P,L,C> withComponentColumn(com.vaadin.flow.function.ValueProvider<T,com.vaadin.flow.component.Component> valueProvider)
Component using given valueProvider.valueProvider - The value provider to use to provide the column Component using the current row item
instance (not null)ItemListingConfigurator.ItemListingColumnBuilder which allow further column configuration and provides the
ItemListingConfigurator.ItemListingColumnBuilder.add() method to add the column to the listingdefault C visibleColumns(P... visibleColumns)
Any property display order declaration configured using displayAsFirst(Object),
displayAsLast(Object), displayBefore(Object, Object) and displayAfter(Object, Object)
will be ignored.
visibleColumns - The visible column properties (not null)C visibleColumns(List<? extends P> visibleColumns)
Any property display order declaration configured using displayAsFirst(Object),
displayAsLast(Object), displayBefore(Object, Object) and displayAfter(Object, Object)
will be ignored.
visibleColumns - The visible column properties (not null)C sortable(boolean sortable)
sortable - Whether all the item listing columns are user-sortableC sortable(P property, boolean sortable)
property - The property to configure (not null)sortable - Whether given property is user-sortableC resizable(boolean resizable)
resizable - Whether all the item listing columns are user-resizableC resizable(P property, boolean resizable)
property - The property to configure (not null)resizable - Whether given property is user-resizableC visible(P property, boolean visible)
property - The property to configure (not null)visible - Whether given property is visibledefault C hidden(P property)
property - The property to configure (not null)visible(Object, boolean)C readOnly(P property, boolean readOnly)
When a column is read-only, no editor component will be provided when the item is in edit mode.
property - The property to configure (not null)readOnly - Whether given property is read-onlyC frozen(P property, boolean frozen)
property - The property to configure (not null)frozen - Whether given property is frozenC frozenColumns(int frozenColumnsCount)
frozenColumnsCount - The number of columns that should be frozenC width(P property, String width)
property - The property to configure (not null)width - the width to setC flexGrow(P property, int flexGrow)
When set to 0, column width is fixed.
property - The property to configure (not null)flexGrow - the flex grow ratio to setC styleNameGenerator(Function<T,String> styleNameGenerator)
Returning null from the generator results in no custom class name being set. Multiple class names
can be returned from the generator as space-separated.
If a column level CSS class name generator is configured through styleNameGenerator(Object, Function)
together with this method, resulting class names from both methods will be effective. Class names generated by
listing are applied to the cells before the class names generated by column. This means that if the classes
contain conflicting style properties, column's classes will win.
styleNameGenerator - The function to use to generate the row CSS style class nameC styleNameGenerator(P property, Function<T,String> styleNameGenerator)
Returning null from the generator results in no custom class name being set. Multiple class names
can be returned from the generator as space-separated.
If a row CSS style class name generator is configured through styleNameGenerator(Function) together with
this method, resulting class names from both generators will be effective. Class names generated by the listing
are applied to the cells before the class names generated by column. This means that if the classes contain
conflicting style properties, column's classes will win.
property - The property to configure (not null)styleNameGenerator - The function to use to generate the cell CSS style class nameC expand(P property)
The flew grow value for the provided column will be set to 1, while the other columns flew grow
value will be set to 0.
property - The property which identifies the column to expandC alignment(P property, ItemListingConfigurator.ColumnAlignment alignment)
Default is ItemListingConfigurator.ColumnAlignment.LEFT.
property - The property to configure (not null)alignment - the text alignment to setC renderer(P property, com.vaadin.flow.data.renderer.Renderer<T> renderer)
Renderer to use for the column which corresponds to given property.property - The property to configure (not null)renderer - The column renderer to usedefault <R extends com.vaadin.flow.component.Component> C componentRenderer(P property, Function<T,R> renderer)
Component, using given function to provide the
component for each listing item.R - Component typeproperty - The property to configure (not null)renderer - The function to use to provide the component for each listing item (not null)C valueProvider(P property, com.vaadin.flow.function.ValueProvider<T,String> valueProvider)
ValueProvider to use to obtain the text to display in the column which corresponds to given
property.property - The property to configure (not null)valueProvider - The value provider to useC sortComparator(P property, Comparator<T> comparator)
property - The property to configure (not null)comparator - The comparator to use with in-memory sortingC sortUsing(P property, List<P> sortProperties)
property - The property to configure (not null)sortProperties - The properties to use to sort the columndefault C sortUsing(P property, P... sortProperties)
property - The property to configure (not null)sortProperties - The properties to use to sort the columnC sortProvider(P property, Function<com.holonplatform.core.query.QuerySort.SortDirection,Stream<ItemSort<P>>> sortProvider)
ItemSorts to use when the column which corresponds to given
property is user-sorted.property - The property to configure (not null)sortProvider - Sort providerC header(P property, com.holonplatform.core.i18n.Localizable header)
property - The property to configure (not null)header - Localizable column header text (not null)default C header(P property, String header)
property - The property to configure (not null)header - The column header textdefault C header(P property, String defaultHeader, String headerMessageCode)
property - The property to configure (not null)defaultHeader - The default column header textheaderMessageCode - The column header text translation message codeC headerComponent(P property, com.vaadin.flow.component.Component header)
Component to use as header for the column which corresponds to given property.property - The property to configure (not null)header - The column header componentC footer(P property, com.holonplatform.core.i18n.Localizable footer)
property - The property to configure (not null)footer - Localizable column footer text (not null)default C footer(P property, String footer)
property - The property to configure (not null)footer - The column footer textdefault C footer(P property, String defaultFooter, String footerMessageCode)
property - The property to configure (not null)defaultFooter - The default column footer textfooterMessageCode - The column footer text translation message codeC footerComponent(P property, com.vaadin.flow.component.Component footer)
Component to use as footer for the column which corresponds to given property.property - The property to configure (not null)footer - The column footer componentC pageSize(int pageSize)
Note: the number of items in the server-side memory can be considerably higher than the page size, since the component can show more than one page at a time.
pageSize - the maximum number of items sent per request. Should be greater than zeroC heightByRows(boolean heightByRows)
true, the listing's height is defined by the number of its rows. All items are fetched from the
data provider, and the Grid shows no vertical scroll bar.heightByRows - true to make listing compute its height by the number of rows,
false for the default behaviorC columnReorderingAllowed(boolean columnReorderingAllowed)
columnReorderingAllowed - true if column reordering is allowedC itemDetailsRenderer(com.vaadin.flow.data.renderer.Renderer<T> renderer)
renderer - the renderer to use for displaying item details rowsdefault C itemDetailsText(Function<T,String> textProvider)
textProvider - The function to provide the item details textdefault C itemDetailsComponent(Function<T,com.vaadin.flow.component.Component> componentProvider)
Component.componentProvider - The function to provide the item details ComponentC itemDetailsVisibleOnClick(boolean detailsVisibleOnClick)
Default is true.
detailsVisibleOnClick - true to enable opening and closing item details by clicking the rows,
false otherwiseitemDetailsRenderer(Renderer)C selectionMode(Selectable.SelectionMode selectionMode)
selectionMode - The selection mode to set (not null). Use Selectable.SelectionMode.NONE to disable selection.default C singleSelect()
Selectable.SelectionMode.SINGLE.default C multiSelect()
Selectable.SelectionMode.MULTI.default C notSelectable()
Selectable.SelectionMode.NONE.C withSelectionListener(Selectable.SelectionListener<T> selectionListener)
Selectable.SelectionListener to listen to items selection changes.
Selectable.SelectionListeners are triggred only when listing is selectable, i.e. (i.e. Selectable.SelectionMode is not
Selectable.SelectionMode.NONE).
selectionListener - The selection listener to add (not null)C withItemClickListener(ClickEventListener<L,ItemClickEvent<L,T>> listener)
listener - The ClickableRenderer.ItemClickListener to add (not null)C withItemRefreshListener(ItemEventListener<L,T,ItemEvent<L,T>> listener)
The refresh event is fired when tha data provider detect a data change event, either for all the items or for
only one. When only one item is updated, it is available from ItemEvent.getItem().
listener - The ItemEventListener to add (not null)C multiSort(boolean multiSort)
multiSort - true to enable sorting of multiple columns on the client-side, false
to disableC verticalScrollingEnabled(boolean enabled)
enabled - true to enable vertical scrolling, false to disabled itItemListingConfigurator.ItemListingContextMenuBuilder<T,P,L,C> contextMenu()
ItemListingConfigurator.ItemListingContextMenuBuilder to configure and add a context menu to show for each listing item.
Use the ItemListingConfigurator.ItemListingContextMenuBuilder.add() method to add the context menu to the item listing.
By default, the context menu can be opened with a right click or a long touch on the target component.
C header(Consumer<ItemListingConfigurator.EditableItemListingSection<P>> headerConfigurator)
Consumer to configure the item listing header section, using the ItemListing.ItemListingSection
API.headerConfigurator - The item listing header section configurator (not null)C footer(Consumer<ItemListingConfigurator.EditableItemListingSection<P>> footerConfigurator)
Consumer to configure the item listing footer section, using the ItemListing.ItemListingSection
API.footerConfigurator - The item listing footer section configurator (not null)C editable(boolean editable)
Use withEditorSaveListener(EditorSaveListener) to register a listener for editor item save events.
editable - whether the listing is editabledefault C editable()
C editorComponent(P property, Function<T,? extends com.vaadin.flow.component.Component> editorComponentProvider)
Component to display when the column bound to given property is in editing mode.property - The property for which to set the editor component (not null)editorComponentProvider - The editor component provider (not null)default C editorComponent(P property, com.vaadin.flow.component.Component editorComponent)
Component to display when the column bound to given property is in editing mode.property - The property for which to set the editor component (not null)editorComponent - The editor component (not null)C editorBuffered(boolean buffered)
true.
When the editor is in buffered mode, edits are only committed when the user clicks the save button. In unbuffered mode valid changes are automatically committed.
buffered - Whether the editor is in buffered modeC withEditorSaveListener(com.vaadin.flow.component.grid.editor.EditorSaveListener<T> listener)
save events.listener - The listener to add (not null)C withEditorCancelListener(com.vaadin.flow.component.grid.editor.EditorCancelListener<T> listener)
cancel events.listener - The listener to add (not null)C withEditorOpenListener(com.vaadin.flow.component.grid.editor.EditorOpenListener<T> listener)
open events.listener - The listener to add (not null)C withEditorCloseListener(com.vaadin.flow.component.grid.editor.EditorCloseListener<T> listener)
close events.listener - The listener to add (not null)C frozen(boolean frozen)
When the listing is frozen, it never shows any item and no fetch is performed from the data provider.
When the ItemSet.refresh() method is called, the frozen state is automatically set to
false.
frozen - Whether the listing is frozenCopyright © 2019 The Holon Platform. All rights reserved.