Add APIs to inform components of stale objects in DataProvider (#8271)
* Add DataProvider refreshItem for single item update
* Add 'id' concept for DataProviders
This patch also adds a simplified data provider that can replace items
based on their id. This can be used to simulate stale objects from an actual
backend.
* Add refresh logic to Grid SelectionModels
* Remove broken equals and hashCode
* Refresh KeyMapper, clean up some methods
* Fix UI.access in test
* Fix tests and Grid single selection model
* Do clean up before replacing data provider
* Check correct variable for null value
* Fix other selects, add generic tests
* Code style fixes, removed assert
* Merge remote-tracking branch 'origin/master' into 286_refresh_items
* Fix documentation for refreshing an item
* Improve introduction chapter, minor clarifications
* Merge remote-tracking branch 'origin/master' into 287_refresh_items
* Add missing parameters in unit tests
Allow distinct configurable filter and wrapped filter types (#8322)
* Allow distinct configurable filter and wrapped filter types
This enables implementing the use case that was already described
towards the end of datamodel-providers.asciidoc.
Also swaps the order of the callback type parameters to make all three
match the order of the ConfigurableFilterDataProvider type parameters.
Add static helpers for creating callback data providers (#8314)
Cannot overload the same create method for this purpose since it
conflicts with T... overload. Each case is instead given its own
descriptive but still discoverable method name.
* Method names unified to withXyzFilter
* withConfigurableFilter moved to DataProvider
* Remove DataProviderWrapper.convert since it does the same as
DataProvider.withConvertedFilter
* Make javadocs slightly more consistent
* Make type parameters consistent
* Remove outdated filtering concepts
withFilter is removed since filters are supposed to be set as state in
the data provider instead of by wrapping.
AppendabileFilterDataProvider is removed since the data provider is
supposed to do any appending when updating its own state instead of
through wrapping.
This is one of many steps towards #8245
Change BackEndDataProvider into an interface (#8268)
* Change BackEndDataProvider into an interface
BackEndDataProvider is now an interface with methods for setting
sorting options based on SortOrder instances.
AbstractBackEndDataProvider stores sorting options, combines them with
the sorting provided in the query and invokes its own abstract fetch and
size methods.
CallbackDataProvider implements a BackEndDataProvider based on two
lambdas.
This is one of many steps towards #8245
Replace Listing with HasDataProvider and HasFilterableDataProvider (#8122)
* Replace Listing with HasDataProvider and HasFilterableDataProvider
The type parameters of the Listing interface does in practice mean that
it isn't useful for anything. This patch replaces that interface with
separate types for components that require filterable data providers and
components that support any kind of data provider.
The setItem methods are extracted to a common interface that is also
directly implemented by AbstractListing.
Combine and rename setFilter and applyFilter (#7963)
setFilter is an unsuitable name since it looks like a setter even though
it isn't one. It's therefore renamed to withFilter.
The difference between setFilter and applyFilter is very confusing. The
original reason for the distinction was that they had incompatible
return types (Void vs F), but this is resolved by changing the
non-appendable version to use ? instead of Void.
One side effect of this change is that setFilter cannot be used on an
appendable filter provider to create a wrapped data provider without
further filtering support. This theorethical case is still supported by
using convertFilter with a Void -> F converter.