Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » DeferredContentProvider with TreeViewer(DeferredContentProvider with TreeViewer)
DeferredContentProvider with TreeViewer [message #669340] Tue, 10 May 2011 00:58 Go to next message
Elizabeth  is currently offline Elizabeth
Messages: 13
Registered: December 2009
Junior Member
I have a TreeViewer, in which I am trying to limit the count to 500 for performance reasons. My research showed that the DeferredContentProvider seemed to be the way to go. My research said that I would need to set the viewer's input to a IConcurrentModel and that I would need the SWT.Virtual flag on my viewer. I've done both of these, and it is still not limiting the count of items in my viewer. Any suggestions would be greatly appreciated!
Re: DeferredContentProvider with TreeViewer [message #669390 is a reply to message #669340] Tue, 10 May 2011 07:35 Go to previous message
Carsten Habicht is currently offline Carsten Habicht
Messages: 14
Registered: January 2011
Junior Member
Hey Elizabeth,

that could be done with a "virtual" tree viewer when using a lazy content provider. You'll find a nice code snippet there:
http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.jface. snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippe ts/viewers/Snippet030VirtualLazyTableViewer.java?view=markup
(And by the way: the JFace snippets page is a great resource. http://wiki.eclipse.org/JFaceSnippets)

IIRC, the crucial parts are
MyContentProvider implements ILazyContentProvider
v = new TableViewer(shell, SWT.VIRTUAL); and
v.setUseHashlookup(true).

Best
Carsten


Sylphen - Ihr Systemhaus in Mittelhessen - http://www.sylphen.com/
Previous Topic:TableViewer & scroll bars
Next Topic:Table Viewer - How to control the Page Up and Page Down behavior
Goto Forum:
  


Current Time: Mon Sep 22 08:26:06 GMT 2014

Powered by FUDForum. Page generated in 0.01783 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software