com.holonplatform.vaadin.components.builders

## Interface ItemListingBuilder<T,P,C extends ItemListing<T,P>,B extends ItemListingBuilder<T,P,C,B,X>,X extends com.vaadin.ui.Component>

- Type Parameters:
    `T` - Item data type
    `C` - Component type
    `P` - Item property type
    `B` - Concrete builder type
    `X` - Concrete backing component type
  All Superinterfaces:
    BaseItemDataSourceComponentBuilder<B>, ComponentBuilder<C,B>, ComponentConfigurator<B>, ComponentPostProcessorSupport<X,B>, ItemDataSourceComponentBuilder<T,C,B>
  All Known Subinterfaces:
    BeanListingBuilder<T>, ItemListingBuilder.BaseGridItemListingBuilder<T,P,C,B>, ItemListingBuilder.GridItemListingBuilder<T,C,B>, PropertyListingBuilder<C,B,X>, PropertyListingBuilder.BaseGridPropertyListingBuilder<C,B>, PropertyListingBuilder.GridPropertyListingBuilder

      public interface ItemListingBuilder<T,P,C extends ItemListing<T,P>,B extends ItemListingBuilder<T,P,C,B,X>,X extends com.vaadin.ui.Component>
      extends ItemDataSourceComponentBuilder<T,C,B>, ComponentPostProcessorSupport<X,B>

  Base `ItemListing` builder.
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `ItemListingBuilder.BaseGridItemListingBuilder<T,P,C extends ItemListing<T,P>,B extends ItemListingBuilder.BaseGridItemListingBuilder<T,P,C,B>>` Base builder to create an `ItemListing` with a `Grid` as backing component.
    `static class` | `ItemListingBuilder.ColumnHeaderMode` Grid column header mode.
    `static interface` | `ItemListingBuilder.FooterBuilder<P>` Builder to create and manage Footer rows.
    `static interface` | `ItemListingBuilder.GridFooterGenerator<T,P>` Generator for footer contents.
    `static interface` | `ItemListingBuilder.GridItemListingBuilder<T,C extends ItemListing<T,String>,B extends ItemListingBuilder.GridItemListingBuilder<T,C,B>>` Builder to create an `ItemListing` with a `Grid` as backing component.
    `static interface` | `ItemListingBuilder.GridSection<ROWTYPE>`
    `static interface` | `ItemListingBuilder.HeaderBuilder<P>` Builder to create and manage Header rows.
    `static interface` | `ItemListingBuilder.ListingFooterRow<P>` A footer row in a `ItemListing`.
    `static interface` | `ItemListingBuilder.ListingHeaderRow<P>` A header row in a `ItemListing`.

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin.components.builders.ComponentConfigurator

      `ComponentConfigurator.BaseComponentConfigurator`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `B` | `alignment(P property, ItemListing.ColumnAlignment alignment)` Set the text alignment for the column which corresponds to given property.
    `B` | `bodyRowHeight(double rowHeight)` Sets the height of a body row.
    `B` | `buffered(boolean buffered)` Set whether the item listing is in buffered mode.
    `C` | `build(Iterable<? extends P> visibleColumns)` Build the `ItemListing` instance, setting given properties as visible columns.
    `default C` | `build(P... visibleColumns)` Build the `ItemListing` instance, setting given properties as visible columns.
    `B` | `columnHidingAllowed(boolean columnHidingAllowed)` Sets whether column hiding by user is allowed or not.
    `B` | `columnReorderingAllowed(boolean columnReorderingAllowed)` Sets whether column reordering is allowed or not.
    `B` | `commitHandler(ItemDataSource.CommitHandler<T> commitHandler)` Set the handler to use to persist item set modifications.
    `B` | `defaultValue(P property, Object defaultValue)` Set a default value to initialize the given `property`.
    `B` | `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 `beforeProperty`.
    `B` | `displayAsFirst(P property)` Configure the column represented by given `property` id to be displayed before any other listing column by default.
    `B` | `displayAsLast(P property)` Configure the column represented by given `property` id to be displayed after any other listing column by default.
    `B` | `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`.
    `B` | `editable(boolean editable)` Set whether the listing is editable.
    `B` | `editable(P property, boolean editable)` Set whether the column which corresponds to given property is editable when listing is in edit mode (`true` by default).
    `B` | `footerRowHeight(double rowHeight)` Sets the height of a footer row.
    `B` | `footerVisible(boolean footerVisible)` Set whether the listing footer is visible.
    `B` | `header(P property, com.holonplatform.core.i18n.Localizable header)` Set the column header to show for given `property`.
    `default B` | `header(P property, String header)` Set the column header to show for given `property`.
    `default B` | `header(P property, String defaultHeader, String headerMessageCode)` Set the column header to show for given `property`.
    `B` | `headerRowHeight(double rowHeight)` Sets the height of a header row.
    `B` | `hidable(P property, boolean hidable)` Sets whether the column which corresponds to given property can be hidden by the user.
    `B` | `hidden(P property, boolean hidden)` Sets whether the column which corresponds to given property is hidden.
    `B` | `hideHeaders()` Hides the table/grid column headers
    `B` | `itemDescriptionGenerator(ItemSet.ItemDescriptionGenerator<T> rowDescriptionGenerator)` Set the `ItemSet.ItemDescriptionGenerator` to use to generate item descriptions (tooltips).
    `B` | `readOnly(P property, boolean readOnly)` Set whether given property is read-only.
    `B` | `rowHeight(double rowHeight)` Sets the height of a row.
    `B` | `selectAllCheckBoxVisibility(com.vaadin.ui.components.grid.MultiSelectionModel.SelectAllCheckBoxVisibility selectAllCheckBoxVisibility)` Sets the select all checkbox visibility mode when the listing is in `Selectable.SelectionMode.MULTI` mode.
    `B` | `selectionMode(Selectable.SelectionMode selectionMode)` Set the listing selection mode.
    `B` | `sortable(boolean sortable)` Set whether all the item listing properties are sortable.
    `B` | `sortable(P property, boolean sortable)` Set whether given property is sortable.
    `B` | `sortGenerator(P property, ItemDataSource.PropertySortGenerator<P> generator)` Set a `ItemDataSource.PropertySortGenerator` to generate `QuerySort`s for given `property`
    `B` | `sortUsing(P property, com.holonplatform.core.Path<?> sortPath)` Declares to use specified `Path` to generate query sorts for given `property`.
    `B` | `style(P property, ItemListing.CellStyleGenerator<T,P> cellStyleGenerator)` Set the `ItemListing.CellStyleGenerator` to call for given `property` to generate column cell style.
    `default B` | `style(P property, String styleName)` Set the column cell style name for given `property`
    `B` | `width(P property, int widthInPixels)` Set the width in pixels for the column which corresponds to given property.
    `B` | `withItemClickListener(ItemListing.ItemClickListener<T,P> listener)` Adds a `ItemListing.ItemClickListener` that gets notified when an item is clicked by the user.
    `B` | `withPropertyReorderListener(ItemListing.PropertyReorderListener<P> listener)` Adds a `ItemListing.PropertyReorderListener` that gets notified when property columns order changes.
    `B` | `withPropertyResizeListener(ItemListing.PropertyResizeListener<P> listener)` Adds a `ItemListing.PropertyResizeListener` that gets notified when a property column is resized.
    `B` | `withPropertyVisibilityListener(ItemListing.PropertyVisibilityListener<P> listener)` Adds a `ItemListing.PropertyVisibilityListener` that gets notified when a property column is hidden or shown.
    `B` | `withRowStyle(ItemListing.RowStyleGenerator<T> rowStyleGenerator)` Add a `ItemListing.RowStyleGenerator` to generate row style names.
    `B` | `withSelectionListener(Selectable.SelectionListener<T> selectionListener)` Add a `Selectable.SelectionListener` to listen to items selection changes.

    - ### Methods inherited from interface com.holonplatform.vaadin.components.builders.ItemDataSourceComponentBuilder

      `dataSource, dataSource`

    - ### Methods inherited from interface com.holonplatform.vaadin.components.builders.BaseItemDataSourceComponentBuilder

      `autoRefresh, batchSize, defaultSort, fixedFilter, fixedSort, maxCacheSize, queryParameter, withQueryConfigurationProvider`

    - ### Methods inherited from interface com.holonplatform.vaadin.components.builders.ComponentBuilder

      `build, deferLocalization, dragSource, dropTarget`

    - ### Methods inherited from interface com.holonplatform.vaadin.components.builders.ComponentConfigurator

      `caption, caption, caption, captionAsHtml, description, description, description, disabled, errorHandler, fullHeight, fullSize, fullWidth, height, height, heightUndefined, hidden, icon, id, notVisible, primaryStyleName, replaceStyleName, responsive, sizeUndefined, styleName, width, width, widthUndefined, withAttachListener, withContextClickListener, withData, withDetachListener, withShortcutListener`

    - ### Methods inherited from interface com.holonplatform.vaadin.components.builders.ComponentPostProcessorSupport

      `withPostProcessor`

- - ### Method Detail

    - #### sortable

          B sortable(boolean sortable)

      Set whether all the item listing properties are sortable.
      Parameters:
        `sortable` - Whether all the item listing properties are sortable
      Returns:
        this

    - #### sortable

          B sortable(P property,
                     boolean sortable)

      Set whether given property is sortable.
      Parameters:
        `property` - Property (not null)
        `sortable` - Whether given property id is sortable
      Returns:
        this

    - #### readOnly

          B readOnly(P property,
                     boolean readOnly)

      Set whether given property is read-only.
      Parameters:
        `property` - Property (not null)
        `readOnly` - Whether given property id is read-only
      Returns:
        this

    - #### defaultValue

          B defaultValue(P property,
                         Object defaultValue)

      Set a default value to initialize the given `property`.
      Parameters:
        `property` - Property (not null)
        `defaultValue` - Default value
      Returns:
        this

    - #### sortUsing

          B sortUsing(P property,
                      com.holonplatform.core.Path<?> sortPath)

      Declares to use specified `Path` to generate query sorts for given `property`.
      Parameters:
        `property` - Property for which to declare the sort path (not null)
        `sortPath` - Sort path to use (not null)
      Returns:
        this

    - #### sortGenerator

          B sortGenerator(P property,
                          ItemDataSource.PropertySortGenerator<P> generator)

      Set a `ItemDataSource.PropertySortGenerator` to generate `QuerySort`s for given `property`
      Parameters:
        `property` - Property to sort (not null)
        `generator` - PropertySortGenerator (not null)
      Returns:
        this

    - #### buffered

          B buffered(boolean buffered)

      Set whether the item listing is in buffered mode. Default is `false`.

      When buffered, the listing component requires a specific action to commit item modifications to persistence store, using `ItemListing.commit()`, and changes can be discarded using `ItemListing.discard()`.

      When not buffered, the `ItemDataSource.CommitHandler`, if configured, will be invoked at any item set modification (item added, updated or removed).

      Parameters:
        `buffered` - Buffered mode to set
      Returns:
        this

    - #### commitHandler

          B commitHandler(ItemDataSource.CommitHandler<T> commitHandler)

      Set the handler to use to persist item set modifications.
      Parameters:
        `commitHandler` - Handler to set (not null)
      Returns:
        this

    - #### rowHeight

          B rowHeight(double rowHeight)

      Sets the height of a row. If -1 (default), the row height is calculated based on the theme for an empty row before the listing is displayed.

      Note that all header, body and footer rows get the same height if explicitly set. In automatic mode, each section is calculated separately based on an empty row of that type.

      Parameters:
        `rowHeight` - The height of a row in pixels or -1 for automatic calculation
      Returns:
        this
      See Also:
        `bodyRowHeight(double)`, `headerRowHeight(double)`, `footerRowHeight(double)`

    - #### bodyRowHeight

          B bodyRowHeight(double rowHeight)

      Sets the height of a body row. If -1 (default), the row height is calculated based on the theme for an empty row before the listing is displayed.
      Parameters:
        `rowHeight` - The height of a body row in pixels or -1 for automatic calculation
      Returns:
        this

    - #### headerRowHeight

          B headerRowHeight(double rowHeight)

      Sets the height of a header row. If -1 (default), the row height is calculated based on the theme for an empty row before the listing is displayed.
      Parameters:
        `rowHeight` - The height of a header row in pixels or -1 for automatic calculation
      Returns:
        this

    - #### footerRowHeight

          B footerRowHeight(double rowHeight)

      Sets the height of a footer row. If -1 (default), the row height is calculated based on the theme for an empty row before the listing is displayed.
      Parameters:
        `rowHeight` - The height of a footer row in pixels or -1 for automatic calculation
      Returns:
        this

    - #### hideHeaders

          B hideHeaders()

      Hides the table/grid column headers
      Returns:
        this

    - #### withRowStyle

          B withRowStyle(ItemListing.RowStyleGenerator<T> rowStyleGenerator)

      Add a `ItemListing.RowStyleGenerator` to generate row style names.
      Parameters:
        `rowStyleGenerator` - Row style generator
      Returns:
        this

    - #### header

          B header(P property,
                   com.holonplatform.core.i18n.Localizable header)

      Set the column header to show for given `property`.

      By default, if the property is `Localizable`, the `Localizable.getMessage()` (and `Localizable.getMessageCode()` if a `LocalizationContext` is available) is used as column header.

      Parameters:
        `property` - Item property to set the header for (not null)
        `header` - Localizable column header (not null)
      Returns:
        this

    - #### header

          default B header(P property,
                           String header)

      Set the column header to show for given `property`.
      Parameters:
        `property` - Item property to set the header for (not null)
        `header` - Column header
      Returns:
        this

    - #### header

          default B header(P property,
                           String defaultHeader,
                           String headerMessageCode)

      Set the column header to show for given `property`.
      Parameters:
        `property` - Item property to set the header for (not null)
        `defaultHeader` - Default column header
        `headerMessageCode` - Column header translation message code
      Returns:
        this

    - #### alignment

          B alignment(P property,
                      ItemListing.ColumnAlignment alignment)

      Set the text alignment for the column which corresponds to given property.
      Parameters:
        `property` - Item property to set the alignment for (not null)
        `alignment` - Alignment
      Returns:
        this

    - #### width

          B width(P property,
                  int widthInPixels)

      Set the width in pixels for the column which corresponds to given property.
      Parameters:
        `property` - Item property to set the width for (not null)
        `widthInPixels` - Width in pixel
      Returns:
        this

    - #### editable

          B editable(P property,
                     boolean editable)

      Set whether the column which corresponds to given property is editable when listing is in edit mode (`true` by default).
      Parameters:
        `property` - Item property to set editable or not (not null)
        `editable` - `true` to set the column editable, `false` otherwise
      Returns:
        this

    - #### hidable

          B hidable(P property,
                    boolean hidable)

      Sets whether the column which corresponds to given property can be hidden by the user.
      Parameters:
        `property` - Item property to set hidable or not (not null)
        `hidable` - `true` if the column which corresponds to given property can be hidden by the user
      Returns:
        this

    - #### hidden

          B hidden(P property,
                   boolean hidden)

      Sets whether the column which corresponds to given property is hidden.
      Parameters:
        `property` - Item property to set hidden or not (not null)
        `hidden` - `true` if column is hidden
      Returns:
        this

    - #### style

          B style(P property,
                  ItemListing.CellStyleGenerator<T,P> cellStyleGenerator)

      Set the `ItemListing.CellStyleGenerator` to call for given `property` to generate column cell style.
      Parameters:
        `property` - Item property to set the style generator for (not null)
        `cellStyleGenerator` - Cell style generator (not null)
      Returns:
        this

    - #### style

          default B style(P property,
                          String styleName)

      Set the column cell style name for given `property`
      Parameters:
        `property` - Item property to set the style for (not null)
        `styleName` - The property column style name
      Returns:
        this

    - #### displayAsFirst

          B displayAsFirst(P property)

      Configure the column represented by given `property` id to be displayed before any other listing column by default.

      The default property/column display behaviour is applyed when the `ComponentBuilder.build()` method is used to construct the item listing, whilst the default display behaviour is ignored when either `build(Iterable)` or `build(Object...)` method is used, because the property/column ordering is explicitly provided.

      Parameters:
        `property` - Property which represents the column to display as first (not null)
      Returns:
        this

    - #### displayAsLast

          B displayAsLast(P property)

      Configure the column represented by given `property` id to be displayed after any other listing column by default.

      The default property/column display behaviour is applyed when the `ComponentBuilder.build()` method is used to construct the item listing, whilst the default display behaviour is ignored when either `build(Iterable)` or `build(Object...)` method is used, because the property/column ordering is explicitly provided.

      Parameters:
        `property` - Property which represents the column to display as last (not null)
      Returns:
        this

    - #### displayBefore

          B 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`.

      The default property/column display behaviour is applyed when the `ComponentBuilder.build()` method is used to construct the item listing, whilst the default display behaviour is ignored when either `build(Iterable)` or `build(Object...)` method is used, because the property/column ordering is explicitly provided.

      Parameters:
        `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)
      Returns:
        this

    - #### displayAfter

          B 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 `beforeProperty`.

      The default property/column display behaviour is applyed when the `ComponentBuilder.build()` method is used to construct the item listing, whilst the default display behaviour is ignored when either `build(Iterable)` or `build(Object...)` method is used, because the property/column ordering is explicitly provided.

      Parameters:
        `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)
      Returns:
        this

    - #### selectionMode

          B selectionMode(Selectable.SelectionMode selectionMode)

      Set the listing selection mode.
      Parameters:
        `selectionMode` - Selection mode to set (not null). Use `Selectable.SelectionMode.NONE` to disable selection.
      Returns:
        this

    - #### selectAllCheckBoxVisibility

          B selectAllCheckBoxVisibility(com.vaadin.ui.components.grid.MultiSelectionModel.SelectAllCheckBoxVisibility selectAllCheckBoxVisibility)

      Sets the select all checkbox visibility mode when the listing is in `Selectable.SelectionMode.MULTI` mode.
      Parameters:
        `selectAllCheckBoxVisibility` - the visiblity mode to use
      Returns:
        this

    - #### withSelectionListener

          B withSelectionListener(Selectable.SelectionListener<T> selectionListener)

      Add a `Selectable.SelectionListener` to listen to items selection changes.

      `Selectable.SelectionListener`s are triggred only when listing is selectable, i.e. (i.e. `Selectable.SelectionMode` is not `Selectable.SelectionMode.NONE`).

      Parameters:
        `selectionListener` - Selection listener to add (not null)
      Returns:
        this

    - #### editable

          B editable(boolean editable)

      Set whether the listing is editable.
      Parameters:
        `editable` - `true` to set the listing editable, `false` otherwise
      Returns:
        this

    - #### withItemClickListener

          B withItemClickListener(ItemListing.ItemClickListener<T,P> listener)

      Adds a `ItemListing.ItemClickListener` that gets notified when an item is clicked by the user.
      Parameters:
        `listener` - ItemClickListener to add (not null)
      Returns:
        this

    - #### withPropertyReorderListener

          B withPropertyReorderListener(ItemListing.PropertyReorderListener<P> listener)

      Adds a `ItemListing.PropertyReorderListener` that gets notified when property columns order changes.
      Parameters:
        `listener` - Listener to add (not null)
      Returns:
        this

    - #### withPropertyResizeListener

          B withPropertyResizeListener(ItemListing.PropertyResizeListener<P> listener)

      Adds a `ItemListing.PropertyResizeListener` that gets notified when a property column is resized.
      Parameters:
        `listener` - Listener to add (not null)
      Returns:
        this

    - #### withPropertyVisibilityListener

          B withPropertyVisibilityListener(ItemListing.PropertyVisibilityListener<P> listener)

      Adds a `ItemListing.PropertyVisibilityListener` that gets notified when a property column is hidden or shown.
      Parameters:
        `listener` - Listener to add (not null)
      Returns:
        this

    - #### itemDescriptionGenerator

          B itemDescriptionGenerator(ItemSet.ItemDescriptionGenerator<T> rowDescriptionGenerator)

      Set the `ItemSet.ItemDescriptionGenerator` to use to generate item descriptions (tooltips).
      Parameters:
        `rowDescriptionGenerator` - Generator to set (not null)
      Returns:
        this

    - #### columnHidingAllowed

          B columnHidingAllowed(boolean columnHidingAllowed)

      Sets whether column hiding by user is allowed or not.
      Parameters:
        `columnHidingAllowed` - `true` if column hiding is allowed
      Returns:
        this

    - #### columnReorderingAllowed

          B columnReorderingAllowed(boolean columnReorderingAllowed)

      Sets whether column reordering is allowed or not.
      Parameters:
        `columnReorderingAllowed` - `true` if column reordering is allowed
      Returns:
        this

    - #### footerVisible

          B footerVisible(boolean footerVisible)

      Set whether the listing footer is visible.
      Parameters:
        `footerVisible` - whether the listing footer is visible
      Returns:
        this

    - #### build

          default C build(P... visibleColumns)

      Build the `ItemListing` instance, setting given properties as visible columns.

      Use `ComponentBuilder.build()` to build an `ItemListing` using all data source properties as visible columns.

      Parameters:
        `visibleColumns` - Visible column properties (not null)
      Returns:
        `ItemListing` component

    - #### build

          C build(Iterable<? extends P> visibleColumns)

      Build the `ItemListing` instance, setting given properties as visible columns.

      Use `ComponentBuilder.build()` to build an `ItemListing` using all data source properties as visible columns.

      Parameters:
        `visibleColumns` - Visible column properties (not null)
      Returns:
        `ItemListing` component

Copyright © 2019 The Holon Platform. All rights reserved.