public interface FluentHasHierarchicalDataProvider<THIS extends FluentHasHierarchicalDataProvider<THIS,ITEM>,ITEM> extends com.vaadin.data.HasHierarchicalDataProvider<ITEM>, FluentHasDataProvider<THIS,ITEM>
FluentComponent.FluentFocusable<C extends FluentComponent.FluentFocusable<C>>com.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 |
|---|---|
default THIS |
withItems(Collection<ITEM> items)
Sets the data items of this component provided as a collection.
|
default THIS |
withItems(Collection<ITEM> rootItems,
com.vaadin.data.ValueProvider<ITEM,Collection<ITEM>> childItemProvider)
Sets the root data items of this component provided as a collection and
recursively populates them with child items with the given value
provider.
|
default THIS |
withItems(ITEM... items)
Sets the data items of this listing.
|
default THIS |
withItems(Stream<ITEM> items)
Sets the data items of this component provided as a stream.
|
default THIS |
withItems(Stream<ITEM> rootItems,
com.vaadin.data.ValueProvider<ITEM,Stream<ITEM>> childItemProvider)
Sets the root data items of this component provided as a stream and
recursively populates them with child items with the given value
provider.
|
default THIS |
withTreeData(com.vaadin.data.TreeData<ITEM> treeData)
Sets a new
TreeDataProvider wrapping the given TreeData. |
getTreeData, setItems, setItems, setItems, setItems, setItems, setTreeDatawithDataProviderwithCaption, withEnabled, withIcon, withId, withParent, withPrimaryStyleName, withStyleName, withStyleName, withVisibleaddListener, 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, setVisible, writeDesignaddAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlerwithFullHeight, withFullSize, withFullWidth, withHeight, withHeight, withSize, withUndefinedHeight, withUndefinedSize, withUndefinedWidth, withWidth, withWidthdefault THIS withTreeData(com.vaadin.data.TreeData<ITEM> treeData)
TreeDataProvider wrapping the given TreeData.treeData - the tree data to setHasHierarchicalDataProvider.setTreeData(TreeData)default THIS withItems(Collection<ITEM> rootItems, com.vaadin.data.ValueProvider<ITEM,Collection<ITEM>> childItemProvider)
The provided items are wrapped into a TreeDataProvider backed by
a flat TreeData structure. The data provider instance is used as
a parameter for the HasDataProvider.setDataProvider(DataProvider) method. It
means that the items collection can be accessed later on via
HasHierarchicalDataProvider.getTreeData():
Collection<Person> grandParents = getGrandParents();
HasHierarchicalDataProvider<Person> treeGrid = new TreeGrid<>();
treeGrid.setItems(grandParents, Person::getChildren);
...
TreeData<Person> data = treeGrid.getTreeData();
The returned TreeData instance may be used as-is to add, remove
or modify items in the hierarchy. These modifications to the object are
not automatically reflected back to the TreeGrid. Items modified should
be refreshed with DataProvider.refreshItem(Object)
and when adding or removing items
DataProvider.refreshAll() should be called.
rootItems - the root items to display, not nullchildItemProvider - the value provider used to recursively populate the given root
items with child items, not nullHasHierarchicalDataProvider.setItems(Collection, ValueProvider)default THIS withItems(Stream<ITEM> rootItems, com.vaadin.data.ValueProvider<ITEM,Stream<ITEM>> childItemProvider)
The provided items are wrapped into a TreeDataProvider backed by
a flat TreeData structure. The data provider instance is used as
a parameter for the HasDataProvider.setDataProvider(DataProvider) method. It
means that the items collection can be accessed later on via
HasHierarchicalDataProvider.getTreeData():
Stream<Person> grandParents = getGrandParents();
HasHierarchicalDataProvider<Person> treeGrid = new TreeGrid<>();
treeGrid.setItems(grandParents, Person::getChildren);
...
TreeData<Person> data = treeGrid.getTreeData();
The returned TreeData instance may be used as-is to add, remove
or modify items in the hierarchy. These modifications to the object are
not automatically reflected back to the TreeGrid. Items modified should
be refreshed with DataProvider.refreshItem(Object)
and when adding or removing items
DataProvider.refreshAll() should be called.
rootItems - the root items to display, not nullchildItemProvider - the value provider used to recursively populate the given root
items with child items, not nullHasHierarchicalDataProvider.setItems(Stream, ValueProvider)default THIS withItems(Collection<ITEM> items)
The provided items are wrapped into a TreeDataProvider backed by
a flat TreeData structure. The data provider instance is used as
a parameter for the HasDataProvider.setDataProvider(DataProvider) method. It
means that the items collection can be accessed later on via
HasHierarchicalDataProvider.getTreeData():
HasHierarchicalDataProvider<String> treeGrid = new TreeGrid<>();
treeGrid.setItems(Arrays.asList("a","b"));
...
TreeData<String> data = treeGrid.getTreeData();
The returned TreeData instance may be used as-is to add, remove
or modify items in the hierarchy. These modifications to the object are
not automatically reflected back to the TreeGrid. Items modified should
be refreshed with DataProvider.refreshItem(Object)
and when adding or removing items
DataProvider.refreshAll() should be called.
withItems in interface FluentHasDataProvider<THIS extends FluentHasHierarchicalDataProvider<THIS,ITEM>,ITEM>withItems in interface FluentHasItems<THIS extends FluentHasHierarchicalDataProvider<THIS,ITEM>,ITEM>items - the data items to display, not nullHasHierarchicalDataProvider.setItems(Collection)default THIS withItems(Stream<ITEM> items)
The provided items are wrapped into a TreeDataProvider backed by
a flat TreeData structure. The data provider instance is used as
a parameter for the HasDataProvider.setDataProvider(DataProvider) method. It
means that the items collection can be accessed later on via
HasHierarchicalDataProvider.getTreeData():
HasHierarchicalDataProvider<String> treeGrid = new TreeGrid<>();
treeGrid.setItems(Stream.of("a","b"));
...
TreeData<String> data = treeGrid.getTreeData();
The returned TreeData instance may be used as-is to add, remove
or modify items in the hierarchy. These modifications to the object are
not automatically reflected back to the TreeGrid. Items modified should
be refreshed with DataProvider.refreshItem(Object)
and when adding or removing items
DataProvider.refreshAll() should be called.
withItems in interface FluentHasItems<THIS extends FluentHasHierarchicalDataProvider<THIS,ITEM>,ITEM>items - the data items to display, not nullHasHierarchicalDataProvider.setItems(Stream)default THIS withItems(ITEM... items)
The provided items are wrapped into a TreeDataProvider backed by
a flat TreeData structure. The data provider instance is used as
a parameter for the HasDataProvider.setDataProvider(DataProvider) method. It
means that the items collection can be accessed later on via
HasHierarchicalDataProvider.getTreeData():
TreeGrid<String> treeGrid = new TreeGrid<>();
treeGrid.setItems("a","b");
...
TreeData<String> data = treeGrid.getTreeData();
The returned TreeData instance may be used as-is to add, remove
or modify items in the hierarchy. These modifications to the object are
not automatically reflected back to the TreeGrid. Items modified should
be refreshed with DataProvider.refreshItem(Object)
and when adding or removing items
DataProvider.refreshAll() should be called.
withItems in interface FluentHasItems<THIS extends FluentHasHierarchicalDataProvider<THIS,ITEM>,ITEM>items - the data items to display, not nullHasHierarchicalDataProvider.setItems(Object...)Copyright © 2017 Jean-Christophe Fortier. All rights reserved.