T
- Item data typeC
- Component typeP
- Item property typeB
- Concrete builder typeX
- Concrete backing component typepublic 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>
ItemListing
builder.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 . |
ComponentConfigurator.BaseComponentConfigurator
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)
|
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. |
dataSource, dataSource
autoRefresh, batchSize, defaultSort, fixedFilter, fixedSort, maxCacheSize, queryParameter, withQueryConfigurationProvider
build, deferLocalization, dragSource, dropTarget
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
withPostProcessor
B sortable(boolean sortable)
sortable
- Whether all the item listing properties are sortableB sortable(P property, boolean sortable)
property
- Property (not null)sortable
- Whether given property id is sortableB readOnly(P property, boolean readOnly)
property
- Property (not null)readOnly
- Whether given property id is read-onlyB defaultValue(P property, Object defaultValue)
property
.property
- Property (not null)defaultValue
- Default valueB sortUsing(P property, com.holonplatform.core.Path<?> sortPath)
Path
to generate query sorts for given property
.property
- Property for which to declare the sort path (not null)sortPath
- Sort path to use (not null)B sortGenerator(P property, ItemDataSource.PropertySortGenerator<P> generator)
property
- Property to sort (not null)generator
- PropertySortGenerator (not null)B buffered(boolean buffered)
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).
buffered
- Buffered mode to setB commitHandler(ItemDataSource.CommitHandler<T> commitHandler)
commitHandler
- Handler to set (not null)B rowHeight(double rowHeight)
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.
rowHeight
- The height of a row in pixels or -1 for automatic calculationbodyRowHeight(double)
,
headerRowHeight(double)
,
footerRowHeight(double)
B bodyRowHeight(double rowHeight)
rowHeight
- The height of a body row in pixels or -1 for automatic calculationB headerRowHeight(double rowHeight)
rowHeight
- The height of a header row in pixels or -1 for automatic calculationB footerRowHeight(double rowHeight)
rowHeight
- The height of a footer row in pixels or -1 for automatic calculationB hideHeaders()
B withRowStyle(ItemListing.RowStyleGenerator<T> rowStyleGenerator)
ItemListing.RowStyleGenerator
to generate row style names.rowStyleGenerator
- Row style generatorB header(P property, com.holonplatform.core.i18n.Localizable header)
property
.
By default, if the property is Localizable
, the Localizable.getMessage()
(and
Localizable.getMessageCode()
if a LocalizationContext
is available) is used as column header.
property
- Item property to set the header for (not null)header
- Localizable column header (not null)default B header(P property, String header)
property
.property
- Item property to set the header for (not null)header
- Column headerdefault B header(P property, String defaultHeader, String headerMessageCode)
property
.property
- Item property to set the header for (not null)defaultHeader
- Default column headerheaderMessageCode
- Column header translation message codeB alignment(P property, ItemListing.ColumnAlignment alignment)
property
- Item property to set the alignment for (not null)alignment
- AlignmentB width(P property, int widthInPixels)
property
- Item property to set the width for (not null)widthInPixels
- Width in pixelB editable(P property, boolean editable)
true
by default).property
- Item property to set editable or not (not null)editable
- true
to set the column editable, false
otherwiseB hidable(P property, boolean hidable)
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 userB hidden(P property, boolean hidden)
property
- Item property to set hidden or not (not null)hidden
- true
if column is hiddenB style(P property, ItemListing.CellStyleGenerator<T,P> cellStyleGenerator)
ItemListing.CellStyleGenerator
to call for given property
to generate column cell style.property
- Item property to set the style generator for (not null)cellStyleGenerator
- Cell style generator (not null)default B style(P property, String styleName)
property
property
- Item property to set the style for (not null)styleName
- The property column style nameB displayAsFirst(P property)
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.
property
- Property which represents the column to display as first (not null)B displayAsLast(P property)
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.
property
- Property which represents the column to display as last (not null)B displayBefore(P property, P beforeProperty)
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.
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)B displayAfter(P property, P afterProperty)
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.
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)B selectionMode(Selectable.SelectionMode selectionMode)
selectionMode
- Selection mode to set (not null). Use Selectable.SelectionMode.NONE
to disable selection.B selectAllCheckBoxVisibility(com.vaadin.ui.components.grid.MultiSelectionModel.SelectAllCheckBoxVisibility selectAllCheckBoxVisibility)
Selectable.SelectionMode.MULTI
mode.selectAllCheckBoxVisibility
- the visiblity mode to useB withSelectionListener(Selectable.SelectionListener<T> selectionListener)
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
).
selectionListener
- Selection listener to add (not null)B editable(boolean editable)
editable
- true
to set the listing editable, false
otherwiseB withItemClickListener(ItemListing.ItemClickListener<T,P> listener)
ItemListing.ItemClickListener
that gets notified when an item is clicked by the user.listener
- ItemClickListener to add (not null)B withPropertyReorderListener(ItemListing.PropertyReorderListener<P> listener)
ItemListing.PropertyReorderListener
that gets notified when property columns order changes.listener
- Listener to add (not null)B withPropertyResizeListener(ItemListing.PropertyResizeListener<P> listener)
ItemListing.PropertyResizeListener
that gets notified when a property column is resized.listener
- Listener to add (not null)B withPropertyVisibilityListener(ItemListing.PropertyVisibilityListener<P> listener)
ItemListing.PropertyVisibilityListener
that gets notified when a property column is hidden or shown.listener
- Listener to add (not null)B itemDescriptionGenerator(ItemSet.ItemDescriptionGenerator<T> rowDescriptionGenerator)
ItemSet.ItemDescriptionGenerator
to use to generate item descriptions (tooltips).rowDescriptionGenerator
- Generator to set (not null)B columnHidingAllowed(boolean columnHidingAllowed)
columnHidingAllowed
- true
if column hiding is allowedB columnReorderingAllowed(boolean columnReorderingAllowed)
columnReorderingAllowed
- true
if column reordering is allowedB footerVisible(boolean footerVisible)
footerVisible
- whether the listing footer is visibledefault C build(P... visibleColumns)
ItemListing
instance, setting given properties as visible columns.
Use ComponentBuilder.build()
to build an ItemListing
using all data source properties as visible columns.
visibleColumns
- Visible column properties (not null)ItemListing
componentC build(Iterable<? extends P> visibleColumns)
ItemListing
instance, setting given properties as visible columns.
Use ComponentBuilder.build()
to build an ItemListing
using all data source properties as visible columns.
visibleColumns
- Visible column properties (not null)ItemListing
componentCopyright © 2018 The Holon Platform. All rights reserved.