Class DeferredContentProvider
java.lang.Object
com._1c.g5.v8.dt.common.ui.jface.viewers.deferred.DeferredContentProvider
- All Implemented Interfaces:
IContentProvider
,ILazyContentProvider
Content provider that performs sorting and filtering in a background thread.
Requires a
TableViewer
created with the SWT.VIRTUAL
flag and an IConcurrentModel
as input.
The sorter and filter must be set directly on the content provider. Any sorter or filter on the TableViewer will be ignored.
The real implementation is in BackgroundContentProvider
. This
object is a lightweight wrapper that adapts the algorithm to work with
TableViewer
.
- Since:
- 3.1
- See Also:
-
DeferredContentProvider
-
Constructor Summary
ConstructorsConstructorDescriptionDeferredContentProvider
(Comparator sortOrder) Creates a DeferredContentProvider with the given sort order.DeferredContentProvider
(Comparator sortOrder, Object selection) Creates a DeferredContentProvider with the given sort order and default selection. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
int
getLimit()
Returns the current maximum number of rows or -1 if unboundedvoid
inputChanged
(Viewer viewer, Object oldInput, Object newInput) void
Sets the filter for this content provider.void
setLimit
(int limit) Sets the maximum number of rows in the table.void
setSortOrder
(Comparator sortOrder) Sets the sort order for this content provider.void
updateElement
(int element)
-
Constructor Details
-
DeferredContentProvider
Creates a DeferredContentProvider with the given sort order.- Parameters:
sortOrder
- a comparator that sorts the content, cannot benull
-
DeferredContentProvider
Creates a DeferredContentProvider with the given sort order and default selection.- Parameters:
sortOrder
- a comparator that sorts the content, cannot benull
selection
- object at the table to be selected as initial, can benull
-
-
Method Details
-
dispose
public void dispose()- Specified by:
dispose
in interfaceIContentProvider
-
inputChanged
- Specified by:
inputChanged
in interfaceIContentProvider
-
setSortOrder
Sets the sort order for this content provider. This sort order takes priority over anything that was supplied to theTableViewer
.- Parameters:
sortOrder
- new sort order. The comparator must be able to support being used in a background thread.
-
setFilter
Sets the filter for this content provider. This filter takes priority over anything that was supplied to theTableViewer
. The filter must be capable of being used in a background thread.- Parameters:
toSet
- filter to set
-
setLimit
public void setLimit(int limit) Sets the maximum number of rows in the table. If the model contains more than this number of elements, only the top elements will be shown based on the current sort order.- Parameters:
limit
- maximum number of rows to show or -1 if unbounded
-
getLimit
public int getLimit()Returns the current maximum number of rows or -1 if unbounded- Returns:
- the current maximum number of rows or -1 if unbounded
-
updateElement
public void updateElement(int element) - Specified by:
updateElement
in interfaceILazyContentProvider
-