Class DeferredContentProvider
- All Implemented Interfaces:
- IContentProvider,- ILazyContentProvider
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
- 
Constructor SummaryConstructorsConstructorDescriptionDeferredContentProvider(Comparator sortOrder) Create a DeferredContentProvider with the given sort order.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddispose()Disposes of this content provider.intgetLimit()Returns the current maximum number of rows or -1 if unboundedvoidinputChanged(Viewer viewer, Object oldInput, Object newInput) Notifies this content provider that the given viewer's input has been switched to a different element.voidSets the filter for this content provider.voidsetLimit(int limit) Sets the maximum number of rows in the table.voidsetSortOrder(Comparator sortOrder) Sets the sort order for this content provider.voidupdateElement(int element) Called when a previously-blank item becomes visible in the TableViewer.
- 
Constructor Details- 
DeferredContentProviderCreate a DeferredContentProvider with the given sort order.- Parameters:
- sortOrder- a comparator that sorts the content.
 
 
- 
- 
Method Details- 
disposepublic void dispose()Description copied from interface:IContentProviderDisposes of this content provider. This is called by the viewer when it is disposed.The viewer should not be updated during this call, as it is in the process of being disposed. The default implementation does nothing. - Specified by:
- disposein interface- IContentProvider
 
- 
inputChangedDescription copied from interface:IContentProviderNotifies this content provider that the given viewer's input has been switched to a different element.A typical use for this method is registering the content provider as a listener to changes on the new input (using model-specific means), and deregistering the viewer from the old input. In response to these change notifications, the content provider should update the viewer (see the add, remove, update and refresh methods on the viewers). The viewer should not be updated during this call, as it might be in the process of being disposed. The default implementation does nothing. - Specified by:
- inputChangedin interface- IContentProvider
- Parameters:
- viewer- the viewer
- oldInput- the old input element, or- nullif the viewer did not previously have an input
- newInput- the new input element, or- nullif the viewer does not have an input
 
- 
setSortOrderSets 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.
 
- 
setFilterSets 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
 
- 
setLimitpublic 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
 
- 
getLimitpublic int getLimit()Returns the current maximum number of rows or -1 if unbounded- Returns:
- the current maximum number of rows or -1 if unbounded
 
- 
updateElementpublic void updateElement(int element) Description copied from interface:ILazyContentProviderCalled when a previously-blank item becomes visible in the TableViewer. If the content provider knows the element at this row, it should respond by calling TableViewer#replace(Object, int). NOTE #updateElement(int index) can be used to determine selection values. TableViewer#replace(Object, int) is not called before returning from this method selections may have missing or stale elements. In this situation it is suggested that the selection is asked for again after he update.- Specified by:
- updateElementin interface- ILazyContentProvider
- Parameters:
- element- The index that is being updated in the table.
 
 
-