com.holonplatform.vaadin.components.builders

## Interface ItemListingBuilder.BaseGridItemListingBuilder<T,P,C extends ItemListing<T,P>,B extends ItemListingBuilder.BaseGridItemListingBuilder<T,P,C,B>>

- Type Parameters:
    `T` - Item data type
    `P` - Item property type
    `C` - Component type
    `B` - Concrete builder type
  All Superinterfaces:
    BaseItemDataSourceComponentBuilder<B>, ComponentBuilder<C,B>, ComponentConfigurator<B>, ComponentPostProcessorSupport<com.vaadin.ui.Grid<T>,B>, ItemDataSourceComponentBuilder<T,C,B>, ItemListingBuilder<T,P,C,B,com.vaadin.ui.Grid<T>>
  All Known Subinterfaces:
    BeanListingBuilder<T>, ItemListingBuilder.GridItemListingBuilder<T,C,B>, PropertyListingBuilder.BaseGridPropertyListingBuilder<C,B>, PropertyListingBuilder.GridPropertyListingBuilder
  Enclosing interface:
    ItemListingBuilder<T,P,C extends ItemListing<T,P>,B extends ItemListingBuilder<T,P,C,B,X>,X extends com.vaadin.ui.Component>

      public static interface ItemListingBuilder.BaseGridItemListingBuilder<T,P,C extends ItemListing<T,P>,B extends ItemListingBuilder.BaseGridItemListingBuilder<T,P,C,B>>
      extends ItemListingBuilder<T,P,C,B,com.vaadin.ui.Grid<T>>

  Base builder to create an `ItemListing` with a `Grid` as backing component.

- - ### Nested Class Summary

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

      `ItemListingBuilder.BaseGridItemListingBuilder<T,P,C extends ItemListing<T,P>,B extends ItemListingBuilder.BaseGridItemListingBuilder<T,P,C,B>>, ItemListingBuilder.ColumnHeaderMode, ItemListingBuilder.FooterBuilder<P>, ItemListingBuilder.GridFooterGenerator<T,P>, ItemListingBuilder.GridItemListingBuilder<T,C extends ItemListing<T,String>,B extends ItemListingBuilder.GridItemListingBuilder<T,C,B>>, ItemListingBuilder.GridSection<ROWTYPE>, ItemListingBuilder.HeaderBuilder<P>, ItemListingBuilder.ListingFooterRow<P>, ItemListingBuilder.ListingHeaderRow<P>`

    - ### 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` | `commitOnRemove()` Sets to call `ItemListing.commit()` to confirm item modifications in data source when an item is removed using `ItemListing.removeItem(Object)` and the listing is in buffered mode.
    `B` | `commitOnSave()` Sets to call `ItemListing.commit()` to confirm item modifications in data source when the editor Save action is triggered and the listing is in buffered mode.
    `B` | `detailsGenerator(ItemListing.ItemDetailsGenerator<T> detailsGenerator)` Set the `ItemListing.ItemDetailsGenerator` to generate row details component
    `B` | `editorBuffered(boolean editorBuffered)` Set whether the row editor is in buffered mode.
    `B` | `editorCancelCaption(com.holonplatform.core.i18n.Localizable caption)` Set the caption for the editor Cancel button.
    `default B` | `editorCancelCaption(String caption)` Set the caption for the editor Cancel button
    `default B` | `editorCancelCaption(String caption, String messageCode)` Set the caption for the editor Cancel button
    `B` | `editorErrorGenerator(com.vaadin.ui.components.grid.EditorErrorGenerator<T> editorErrorGenerator)` Set the `EditorErrorGenerator` of the listing editor.
    `B` | `editorSaveCaption(com.holonplatform.core.i18n.Localizable caption)` Set the caption for the editor Save button.
    `default B` | `editorSaveCaption(String caption)` Set the caption for the editor Save button.
    `default B` | `editorSaveCaption(String caption, String messageCode)` Set the caption for the editor Save button.
    `B` | `expandRatio(P property, int expandRatio)` Set the expandRatio for the column which corresponds to given property.
    `B` | `footer(ItemListingBuilder.FooterBuilder<P> builder)` Set the listing footer builder to create and manage footer rows
    `B` | `footerGenerator(ItemListingBuilder.GridFooterGenerator<T,P> footerGenerator)` Set a `ItemListingBuilder.GridFooterGenerator` to update footer contents when item set changes.
    `B` | `frozenColumns(int frozenColumnsCount)` Sets the number of frozen columns in this listing.
    `B` | `header(ItemListingBuilder.HeaderBuilder<P> builder)` Set the listing header builder to create and manage header rows.
    `B` | `headerHTML(P property, com.holonplatform.core.i18n.Localizable header)` Set the column header for given `property`, displaying it as HTML.
    `default B` | `headerHTML(P property, String header)` Set the column header for given `property`, displaying it as HTML.
    `default B` | `headerHTML(P property, String defaultHeader, String headerMessageCode)` Set the column header for given `property`, displaying it as HTML.
    `B` | `headerMode(P property, ItemListingBuilder.ColumnHeaderMode headerMode)` Set the column header display mode for the column which corresponds to given property.
    `B` | `heightByContents()` Set the height of the listing defined by its contents.
    `B` | `heightByRows(double rows)` Set the height of the listing by defined by a number of rows.
    `B` | `hidingToggleCaption(P property, com.holonplatform.core.i18n.Localizable hidingToggleCaption)` Sets the caption of the hiding toggle for the column which corresponds to given property.
    `default B` | `hidingToggleCaption(P property, String hidingToggleCaption)` Sets the caption of the hiding toggle for the column which corresponds to given property.
    `default B` | `hidingToggleCaption(P property, String hidingToggleCaption, String messageCode)` Sets the caption of the hiding toggle for the column which corresponds to given property.
    `B` | `maxWidth(P property, int widthInPixels)` Set the maximum width in pixels for the column which corresponds to given property.
    `B` | `minimumWidthFromContent(P property, boolean minimumWidthFromContent)` Sets whether the width of the contents in the column which corresponds to given property should be considered minimum width for this column.
    `B` | `minWidth(P property, int widthInPixels)` Set the minimum width in pixels for the column which corresponds to given property.
    `B` | `required(P property)` Set the given property as required in the item listing editor.
    `B` | `required(P property, com.holonplatform.core.i18n.Localizable message)` Set the given property as required in the item listing editor.
    `default B` | `required(P property, String message)` Set the given property as required.
    `default B` | `required(P property, String message, String messageCode, Object... arguments)` Set the given property as required in the item listing editor.
    `B` | `resizable(P property, boolean resizable)` Sets whether the column which corresponds to given property is resizable by the user.
    `B` | `withEditorCancelListener(com.vaadin.ui.components.grid.EditorCancelListener<T> listener)` Register an item editor cancel listener.
    `B` | `withEditorOpenListener(com.vaadin.ui.components.grid.EditorOpenListener<T> listener)` Register an item editor open listener.
    `B` | `withEditorSaveListener(com.vaadin.ui.components.grid.EditorSaveListener<T> listener)` Register an item editor save listener.
    `default B` | `withValidator(com.holonplatform.core.Validator<T> validator)` Adds an item `Validator` to item listing editor.
    `B` | `withValidator(com.vaadin.data.Validator<T> validator)` Adds an item `Validator` to item listing editor.

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

      `alignment, bodyRowHeight, buffered, build, build, columnHidingAllowed, columnReorderingAllowed, commitHandler, defaultValue, displayAfter, displayAsFirst, displayAsLast, displayBefore, editable, editable, footerRowHeight, footerVisible, header, header, header, headerRowHeight, hidable, hidden, hideHeaders, itemDescriptionGenerator, readOnly, rowHeight, selectAllCheckBoxVisibility, selectionMode, sortable, sortable, sortGenerator, sortUsing, style, style, width, withItemClickListener, withPropertyReorderListener, withPropertyResizeListener, withPropertyVisibilityListener, withRowStyle, withSelectionListener`

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

    - #### heightByContents

          B heightByContents()

      Set the height of the listing defined by its contents.
      Returns:
        this

    - #### heightByRows

          B heightByRows(double rows)

      Set the height of the listing by defined by a number of rows.
      Parameters:
        `rows` - Number of rows that should be visible in grid's body
      Returns:
        this

    - #### minWidth

          B minWidth(P property,
                     int widthInPixels)

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

    - #### maxWidth

          B maxWidth(P property,
                     int widthInPixels)

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

    - #### expandRatio

          B expandRatio(P property,
                        int expandRatio)

      Set the expandRatio for the column which corresponds to given property.

      By default, all columns expand equally (treated as if all of them had an expand ratio of 1). Once at least one column gets a defined expand ratio, the implicit expand ratio is removed, and only the defined expand ratios are taken into account.

      If a column has a defined width, it overrides this method's effects.

      Example: A grid with three columns, with expand ratios 0, 1 and 2, respectively. The column with a ratio of 0 is exactly as wide as its contents requires. The column with a ratio of 1 is as wide as it needs, plus a third of any excess space, because we have 3 parts total, and this column reserves only one of those. The column with a ratio of 2, is as wide as it needs to be, plus two thirds of the excess width.

      Parameters:
        `property` - Item property to set the expand ratio for (not null)
        `expandRatio` - Column expand ratio. `0` to not have it expand at all
      Returns:
        this

    - #### minimumWidthFromContent

          B minimumWidthFromContent(P property,
                                    boolean minimumWidthFromContent)

      Sets whether the width of the contents in the column which corresponds to given property should be considered minimum width for this column.

      If this is set to `true` (default), then a column will not shrink to smaller than the width required to show the contents available when calculating the widths (only the widths of the initially rendered rows are considered).

      If this is set to `false` and the column has been set to expand using `expandRatio(...)`, then the contents of the column will be ignored when calculating the width, and the column will thus shrink down to the minimum width if necessary.

      Parameters:
        `property` - Item property (not null)
        `minimumWidthFromContent` - `true` to reserve space for all contents, `false` to allow the column to shrink smaller than the contents
      Returns:
        this

    - #### hidingToggleCaption

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

      Sets the caption of the hiding toggle for the column which corresponds to given property. Shown in the toggle for this column in the grid's sidebar when the column is hidable.
      Parameters:
        `property` - Item property to set the caption for (not null)
        `hidingToggleCaption` - Localizable hiding toggle caption (not null)
      Returns:
        this

    - #### hidingToggleCaption

          default B hidingToggleCaption(P property,
                                        String hidingToggleCaption)

      Sets the caption of the hiding toggle for the column which corresponds to given property. Shown in the toggle for this column in the grid's sidebar when the column is hidable.
      Parameters:
        `property` - Item property to set the caption for (not null)
        `hidingToggleCaption` - Hiding toggle caption
      Returns:
        this

    - #### hidingToggleCaption

          default B hidingToggleCaption(P property,
                                        String hidingToggleCaption,
                                        String messageCode)

      Sets the caption of the hiding toggle for the column which corresponds to given property. Shown in the toggle for this column in the grid's sidebar when the column is hidable.
      Parameters:
        `property` - Item property to set the caption for (not null)
        `hidingToggleCaption` - Hiding toggle caption default message
        `messageCode` - Hiding toggle caption localization message code
      Returns:
        this

    - #### headerMode

          B headerMode(P property,
                       ItemListingBuilder.ColumnHeaderMode headerMode)

      Set the column header display mode for the column which corresponds to given property.
      Parameters:
        `property` - Property for which to set the header mode (not null)
        `headerMode` - Column header mode
      Returns:
        this

    - #### headerHTML

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

      Set the column header for given `property`, displaying it as HTML. The property/column `ItemListingBuilder.ColumnHeaderMode` will be configured as `ItemListingBuilder.ColumnHeaderMode.HTML`.

      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

    - #### headerHTML

          default B headerHTML(P property,
                               String header)

      Set the column header for given `property`, displaying it as HTML. The property/column `ItemListingBuilder.ColumnHeaderMode` will be configured as `ItemListingBuilder.ColumnHeaderMode.HTML`.
      Parameters:
        `property` - Item property to set the header for (not null)
        `header` - Column header
      Returns:
        this

    - #### headerHTML

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

      Set the column header for given `property`, displaying it as HTML. The property/column `ItemListingBuilder.ColumnHeaderMode` will be configured as `ItemListingBuilder.ColumnHeaderMode.HTML`.
      Parameters:
        `property` - Item property to set the header for (not null)
        `defaultHeader` - Default column header
        `headerMessageCode` - Column header translation message code
      Returns:
        this

    - #### resizable

          B resizable(P property,
                      boolean resizable)

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

    - #### frozenColumns

          B frozenColumns(int frozenColumnsCount)

      Sets the number of frozen columns in this listing. Setting the count to 0 means that no data columns will be frozen, but the built-in selection checkbox column will still be frozen if it's in use. Setting the count to -1 will also disable the selection column.
      Parameters:
        `frozenColumnsCount` - The number of columns that should be frozen
      Returns:
        this

    - #### editorBuffered

          B editorBuffered(boolean editorBuffered)

      Set whether the row editor is in buffered mode. In buffered mode, the editor has the `SAVE` and `CANCEL` buttons to commit or discard the item modifications (default mode). In the unbuffered mode, the editor has no buttons and all changed data is committed directly.
      Parameters:
        `editorBuffered` - whether the row editor is in buffered mode
      Returns:
        this

    - #### editorSaveCaption

          B editorSaveCaption(com.holonplatform.core.i18n.Localizable caption)

      Set the caption for the editor Save button.
      Parameters:
        `caption` - Localizable caption (not null)
      Returns:
        this

    - #### editorSaveCaption

          default B editorSaveCaption(String caption)

      Set the caption for the editor Save button.
      Parameters:
        `caption` - Button caption
      Returns:
        this

    - #### editorSaveCaption

          default B editorSaveCaption(String caption,
                                      String messageCode)

      Set the caption for the editor Save button.
      Parameters:
        `caption` - Button caption
        `messageCode` - Caption translation message code
      Returns:
        this

    - #### editorCancelCaption

          B editorCancelCaption(com.holonplatform.core.i18n.Localizable caption)

      Set the caption for the editor Cancel button.
      Parameters:
        `caption` - Localizable caption (not null)
      Returns:
        this

    - #### editorCancelCaption

          default B editorCancelCaption(String caption)

      Set the caption for the editor Cancel button
      Parameters:
        `caption` - Button caption
      Returns:
        this

    - #### editorCancelCaption

          default B editorCancelCaption(String caption,
                                        String messageCode)

      Set the caption for the editor Cancel button
      Parameters:
        `caption` - Button caption
        `messageCode` - Optional caption translation message code
      Returns:
        this

    - #### withEditorSaveListener

          B withEditorSaveListener(com.vaadin.ui.components.grid.EditorSaveListener<T> listener)

      Register an item editor save listener.
      Parameters:
        `listener` - The listener to add
      Returns:
        this

    - #### withEditorCancelListener

          B withEditorCancelListener(com.vaadin.ui.components.grid.EditorCancelListener<T> listener)

      Register an item editor cancel listener.
      Parameters:
        `listener` - The listener to add
      Returns:
        this

    - #### withEditorOpenListener

          B withEditorOpenListener(com.vaadin.ui.components.grid.EditorOpenListener<T> listener)

      Register an item editor open listener.
      Parameters:
        `listener` - The listener to add
      Returns:
        this

    - #### editorErrorGenerator

          B editorErrorGenerator(com.vaadin.ui.components.grid.EditorErrorGenerator<T> editorErrorGenerator)

      Set the `EditorErrorGenerator` of the listing editor.
      Parameters:
        `editorErrorGenerator` - The error generator to add
      Returns:
        this

    - #### withValidator

          default B withValidator(com.holonplatform.core.Validator<T> validator)

      Adds an item `Validator` to item listing editor.
      Parameters:
        `validator` - Validator to add (not null)
      Returns:
        this

    - #### withValidator

          B withValidator(com.vaadin.data.Validator<T> validator)

      Adds an item `Validator` to item listing editor.
      Parameters:
        `validator` - Validator to add (not null)
      Returns:
        this

    - #### required

          B required(P property)

      Set the given property as required in the item listing editor. If a property is required, the field bound to the property will be setted as required, and its validation will fail when empty.
      Parameters:
        `property` - Property to set as required (not null)
      Returns:
        this

    - #### required

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

      Set the given property as required in the item listing editor. If a property is required, the field bound to the property will be setted as required, and its validation will fail when empty.
      Parameters:
        `property` - Property to set as required (not null)
        `message` - The message to use to notify the required validation failure
      Returns:
        this

    - #### required

          default B required(P property,
                             String message,
                             String messageCode,
                             Object... arguments)

      Set the given property as required in the item listing editor. If a property is required, the field bound to the property will be setted as required, and its validation will fail when empty.
      Parameters:
        `property` - Property to set as required (not null)
        `message` - The default message to use to notify the required validation failure
        `messageCode` - The message localization code
        `arguments` - Optional message translation arguments
      Returns:
        this

    - #### required

          default B required(P property,
                             String message)

      Set the given property as required. If a property is required, the `Input` bound to the property will be setted as required, and its validation will fail when empty.
      Parameters:
        `property` - Property to set as required (not null)
        `message` - The default message to use to notify the required validation failure
      Returns:
        this

    - #### commitOnSave

          B commitOnSave()

      Sets to call `ItemListing.commit()` to confirm item modifications in data source when the editor Save action is triggered and the listing is in buffered mode.
      Returns:
        this

    - #### commitOnRemove

          B commitOnRemove()

      Sets to call `ItemListing.commit()` to confirm item modifications in data source when an item is removed using `ItemListing.removeItem(Object)` and the listing is in buffered mode.
      Returns:
        this

    - #### header

          B header(ItemListingBuilder.HeaderBuilder<P> builder)

      Set the listing header builder to create and manage header rows.
      Parameters:
        `builder` - Header builder (not null)
      Returns:
        this

    - #### footer

          B footer(ItemListingBuilder.FooterBuilder<P> builder)

      Set the listing footer builder to create and manage footer rows
      Parameters:
        `builder` - Footer builder (not null)
      Returns:
        this

    - #### footerGenerator

          B footerGenerator(ItemListingBuilder.GridFooterGenerator<T,P> footerGenerator)

      Set a `ItemListingBuilder.GridFooterGenerator` to update footer contents when item set changes.
      Parameters:
        `footerGenerator` - Footer generator
      Returns:
        this

    - #### detailsGenerator

          B detailsGenerator(ItemListing.ItemDetailsGenerator<T> detailsGenerator)

      Set the `ItemListing.ItemDetailsGenerator` to generate row details component
      Parameters:
        `detailsGenerator` - Item details generator (not null)
      Returns:
        this

Copyright © 2019 The Holon Platform. All rights reserved.