T - Item data typeP - Item property typepublic interface ItemListing<T,P> extends ItemSet, Selectable<T>, com.vaadin.ui.Component
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ItemListing.CellStyleGenerator<T,P>
Generator to provide the style names for a cell.
|
static class |
ItemListing.ColumnAlignment
Enumeration of column content alignment options
|
static interface |
ItemListing.ItemClickListener<T,P>
Listener for user click events on an item (a listing row).
|
static interface |
ItemListing.ItemDetailsGenerator<T>
Generator for item (row) details components.
|
static class |
ItemListing.NotBufferedException
Exception thrown when a listing operation is invoked and it is valid only in buffered mode.
|
static interface |
ItemListing.PropertyReorderListener<P>
Listener for column reordering events.
|
static interface |
ItemListing.PropertyResizeListener<P>
Listener for column resizing events.
|
static interface |
ItemListing.PropertyVisibilityListener<P>
Listener for column visibility change events.
|
static interface |
ItemListing.RowStyleGenerator<T>
Generator to provide the style names for an item row.
|
ItemSet.ItemCaptionGenerator<ITEM>, ItemSet.ItemDescriptionGenerator<ITEM>, ItemSet.ItemIconGenerator<ITEM>Selectable.SelectionEvent<T>, Selectable.SelectionListener<T>, Selectable.SelectionModecom.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listenercom.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener| Modifier and Type | Method and Description |
|---|---|
Object |
addItem(T item)
Adds an item to the data source.
|
void |
cancelEditing()
If the listing
isEditable() adn the item editor is open, closes the editor discarding any unsaved
changes. |
void |
clear()
When in buffered mode, clear the buffered items in the internal cache.
|
void |
commit()
Updates all changes since the previous commit.
|
void |
discard()
Discards all changes since last commit.
|
void |
editRow(int rowNumber)
Opens the editor interface for the provided row.
|
Optional<T> |
getItem(Object itemId)
Get the item identified by given
itemId. |
List<P> |
getPropertyColumns()
Gets the current displayed item properties as listing columns
|
boolean |
isBuffered()
Get whether the listing is in buffered mode, i.e. an internal item cache is used.
|
boolean |
isDeselectAllowed()
Gets whether it's allowed to deselect the selected row through the UI.
|
boolean |
isEditable()
Get whether the listing is editable by the user.
|
boolean |
isFooterVisible()
Returns whether the listing footer is visible.
|
boolean |
isItemDetailsVisible(T item)
Gets whether the row details component for given
item is visible. |
void |
refreshItem(T item)
Refresh given item in data source
|
boolean |
removeItem(T item)
Removes given item from the data source.
|
void |
scrollToEnd()
Scrolls to the end of the last data row.
|
void |
scrollToIndex(int index)
Scrolls listing viewport to show the item at given index, if present.
|
void |
scrollToItem(T item)
Scrolls listing viewport to show the given item, if present.
|
void |
scrollToTop()
Scrolls listing rows to top (i.e. to the first row, if any)
|
void |
selectAll()
Select all available items.
|
void |
setDeselectAllowed(boolean deselectAllowed)
Sets whether it's allowed to deselect the selected row through the UI.
|
void |
setEditable(boolean editable)
Set whether the listing is editable by the user.
|
void |
setFooterVisible(boolean visible)
Sets whether the listing footer is visible.
|
void |
setItemDetailsVisible(T item,
boolean visible)
Set whether to show the row details component for given
item. |
void |
setPropertyColumnVisible(P property,
boolean visible)
Show or hide the column bound to given
property. |
void |
setSelectionMode(Selectable.SelectionMode selectionMode)
Set the listing selection mode
|
void |
sort(ItemDataSource.ItemSort<P>... sorts)
Sort the listing using given
ItemDataSource.ItemSort directives. |
addSelectionListener, deselect, deselectAll, getFirstSelectedItem, getSelectedItems, getSelectionMode, isSelected, selectaddListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, readDesign, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible, writeDesignaddAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlerList<P> getPropertyColumns()
void setPropertyColumnVisible(P property, boolean visible)
property.property - Property to show or hide (not null)visible - true to show the column bound to given property, false to
hide itIllegalArgumentException - If specified property is not bound to any columnboolean isFooterVisible()
true if footer is visible, false otherwisevoid setFooterVisible(boolean visible)
visible - true to set the footer visible, false otherwiseboolean 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) throws UnsupportedOperationException
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 itUnsupportedOperationException - If the concrete listing component does not support a row details componentvoid scrollToItem(T item)
This operation is available only in buffered mode.
item - Item to scroll to (not null)ItemListing.NotBufferedException - If the listing is not in buffered modeisBuffered()void scrollToIndex(int index)
index - zero based index of the item to scroll to in the current viewport.void scrollToTop()
void scrollToEnd()
void sort(ItemDataSource.ItemSort<P>... sorts)
ItemDataSource.ItemSort directives.sorts - Item sorts to applyvoid clear()
When not in buffered mode, simply reset the selection, if the listing is slectable.
isBuffered()void setSelectionMode(Selectable.SelectionMode selectionMode)
selectionMode - The selection mode to set (not null)void selectAll()
void setDeselectAllowed(boolean deselectAllowed)
deselectAllowed - true if the selected row can be deselected without selecting another row
instead; otherwise false.boolean isDeselectAllowed()
true if deselection is allowed; otherwise falseOptional<T> getItem(Object itemId)
itemId.
This operation is available only in buffered mode.
itemId - Item id (not null)itemId, empty if not foundItemListing.NotBufferedException - If the listing is not in buffered modeisBuffered()Object addItem(T item)
item - The item to add (not null)boolean removeItem(T item)
item - Item to remove (not null)true if the item was successfully removed from data sourcevoid refreshItem(T item)
item - Item to refresh (not null)UnsupportedOperationException - If the refresh operation is not supported by concrete data storevoid commit()
This operation is available only in buffered mode.
ItemListing.NotBufferedException - If the listing is not in buffered modeisBuffered()void discard()
This operation is available only in buffered mode.
ItemListing.NotBufferedException - If the listing is not in buffered modeisBuffered()boolean isBuffered()
void setEditable(boolean editable)
editable - true to set the listing as editable, false otherwiseboolean isEditable()
true if the listing is editable, false otherwisevoid editRow(int rowNumber)
rowNumber - the row number of the edited itemIllegalStateException - if the editor is not enabled or already editing a different item in buffered modeIllegalArgumentException - if the rowNumber is not in the backing data providervoid cancelEditing()
isEditable() adn the item editor is open, closes the editor discarding any unsaved
changes.IllegalStateException - If the listing is not editableCopyright © 2019 The Holon Platform. All rights reserved.