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:
    ItemListingBuilder.BaseGridItemListingBuilder<T,P,C,B>, ItemListingBuilder.GridItemListingBuilder<T>, PropertyListingBuilder<B,X>, 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 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>` 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` | `buffered(boolean buffered)` Set whether the item listing is in buffered mode.
    `C` | `build(Iterable<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` | `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` | `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` | `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 this column which corresponds to given property is hidden.
    `B` | `hideHeaders()` Hides the table/grid column headers
    `B` | `itemDescriptionGenerator(ItemListing.ItemDescriptionGenerator<T> rowDescriptionGenerator)` Set the `ItemListing.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(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`

    - ### 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(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

    - #### 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 this 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

    - #### 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(ItemListing.ItemDescriptionGenerator<T> rowDescriptionGenerator)

      Set the `ItemListing.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<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 © 2017 The Holon Platform. All rights reserved.