T - Item typeP - Item property typepublic interface ItemListing<T,P> extends ItemSet, Selectable<T>, HasComponent
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ItemListing.EditorComponentGroup<P,T>
A
BoundComponentGroup which represents the listing item editor Inputs and their property
bindings. |
static interface |
ItemListing.ItemListingCell
An
ItemListing section row cell handler. |
static interface |
ItemListing.ItemListingRow<P>
An
ItemListing section row handler. |
static interface |
ItemListing.ItemListingSection<P,R extends ItemListing.ItemListingRow<P>>
ItemListing section handler for header and footer configuration. |
Selectable.SelectionEvent<T>, Selectable.SelectionListener<T>, Selectable.SelectionMode| Modifier and Type | Method and Description |
|---|---|
void |
cancelEditing()
If the listing
isEditable(), closes the editor discarding any unsaved changes. |
void |
editItem(T item)
If the listing
isEditable(), opens the editor interface for the provided item. |
Optional<ItemListing.ItemListingSection<P,? extends ItemListing.ItemListingRow<P>>> |
getFooter()
Get the item listing footer section rows handler, if available.
|
Optional<ItemListing.ItemListingSection<P,? extends ItemListing.ItemListingRow<P>>> |
getHeader()
Get the item listing header section rows handler, if available.
|
List<P> |
getVisibleColumns()
Gets the listing visible columns, in the order thay are displayed.
|
boolean |
isEditable()
Gets whether this listing is editable.
|
Optional<T> |
isEditing()
Checks whether the listing is in edit mode.
|
boolean |
isItemDetailsVisible(T item)
Gets whether the row details component for given
item is visible. |
void |
refreshEditingItem()
If the listing
isEditable(), refreshes the editor components for the current item being edited, if any. |
void |
refreshItem(T item)
Refresh given item in data source
|
boolean |
saveEditingItem()
If the listing
isEditable(), saves the item which is currently in editing, if any. |
void |
setColumnVisible(P property,
boolean visible)
Show or hide the column which corresponds to given
property id. |
void |
setItemDetailsVisible(T item,
boolean visible)
Set whether to show the row details component for given
item. |
void |
setSelectionMode(Selectable.SelectionMode selectionMode)
Set the listing selection mode
|
default void |
sort(ItemSort<P>... sorts)
Sort the listing using given
ItemSort directives. |
void |
sort(List<ItemSort<P>> sorts)
Sort the listing using given
ItemSort directives. |
addSelectionListener, deselect, deselectAll, getFirstSelectedItem, getSelectedItems, getSelectionMode, isSelected, selectcreate, getComponent, getElement, hasEnabled, hasLabel, hasSize, hasStyle, hasValidation, isVisible, setVisibleList<P> getVisibleColumns()
void setColumnVisible(P property, boolean visible)
property id.property - The property which represents the column (not null)visible - true to show the column, false to hide itIllegalArgumentException - If the specified property is not bound to any columnboolean isItemDetailsVisible(T item)
item is visible.item - Item to check whether the row details component is visible (not null)true if row details component is visible for given item, false otherwisevoid setItemDetailsVisible(T item, boolean visible)
item.item - Item for which to show or hide the row details (not null)visible - true to show the row details component, false to hide itdefault void sort(ItemSort<P>... sorts)
ItemSort directives.sorts - The item sorts to applyvoid sort(List<ItemSort<P>> sorts)
ItemSort directives.sorts - The item sorts to applyvoid setSelectionMode(Selectable.SelectionMode selectionMode)
selectionMode - The selection mode to set (not null)void refreshItem(T item)
item - Item to refresh (not null)Optional<ItemListing.ItemListingSection<P,? extends ItemListing.ItemListingRow<P>>> getHeader()
Optional<ItemListing.ItemListingSection<P,? extends ItemListing.ItemListingRow<P>>> getFooter()
boolean isEditable()
When a listing is editable, the editItem(Object) and cancelEditing() methods can be used to
control item editing.
Optional<T> isEditing()
void editItem(T item)
isEditable(), opens the editor interface for the provided item.item - the item to edit (not null) if already editing a different item in buffered modeIllegalArgumentException - if the item is not in the backing data providerIllegalStateException - If the listing is not editablevoid cancelEditing()
isEditable(), closes the editor discarding any unsaved changes.IllegalStateException - If the listing is not editableboolean saveEditingItem()
isEditable(), saves the item which is currently in editing, if any.
When the listing editor is in buffered mode, this method will validate the item and will save any changes made to the editor fields to the edited item if all validators pass. If the write fails then there will be no events and the editor will stay open.
A successful write will fire an editor save event and close the editor that will fire an editor
close event .
NOTE: When the listing editor is not in buffered mode, calling save will have no effect and always return
false.
true if save succeeded, false otherwiseIllegalStateException - If the listing is not editablevoid refreshEditingItem()
isEditable(), refreshes the editor components for the current item being edited, if any.
This is useful when the state of the item is changed while the editor is open.
IllegalStateException - If the listing is not editableCopyright © 2019 The Holon Platform. All rights reserved.