Community
Participate
Working Groups
Created attachment 79536 [details] The class implementing the DeferredTableContentManager JFace provides a DeferredTreeContentManager for fetching in a deferred way the children of a given tree node, i.e., the result of a getChildren in a TreeContentProvider. Nothing is provided for fetching, in the same way, the elements returned by getElements() in a IStructuredContentProvider. A similar manager would allow to fetch table elements and tree roots in the same way children are fetched by the DeferredTreeContentManager. I wrote an adaptation of DeferredTreeContentManager that allows a developer to write content providers that provide their elements in a deferred way. More information: There are two elements involved in the solution: * DeferredTableContentManager * IDeferredStructuredContentProvider (extends IStructuredContentProvider) Here it is what would be their typical usage: private class MyContentProvider implements IDeferredStructuredContentProvider { ... public Object[] getElements(Object inputElement) { //manager is an instance of DeferredTableContentManager return manager.getElements(inputElement); } public void fetchDeferredElements(Object object, IElementCollector collector, IProgressMonitor monitor) { //Do here the long fetching job and put results in collector to add them to the target table } } ... TableViewer viewer = ... viewer.setContentProvider(new MyContentProvider(tableViewer)); viewer.setInput(...); That's it. Notes: The same can be done for Trees and Lists. Unfortunately the add method is defined in AbstractTreeViewer, AbstractListViewer and AbstractTableViewer but not in their common superclass so there have to be 3 different DeferredManagers. In the attachment you can find the implementation. Cheers, Fabio
Created attachment 79537 [details] The IDeferredStructuredContentProvider interface
Created attachment 79684 [details] New implementation and example An RCP application showing the implementation of the idea.
Hitesh is now responsible for watching bugs in the [Viewers] component area.