Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Lazy loading problem
Lazy loading problem [message #763150] Fri, 09 December 2011 09:05 Go to next message
Markus Schindler is currently offline Markus Schindler
Messages: 30
Registered: July 2009
Member
Hi,

following problem is given:

I want to show a table with X rows. I know X, but I have already only Y object from X objects in memory.
For example, I know my table should show 10000 rows, but I have only 100 of them in memory, because the came via a webservice very slow.

So, if I use a Table or TableViewer with SWT.VIRTUAL, I can say
table.setItemCount(10000);

So if I scroll to a position in the table, where the data is not already in memory, i can set the text to "loading...".
But the ILazyContentProvider updateElement(int index) method, is only called once, so if the data is loaded, the method to update the cells, is never
called.

How can I handle this?
Should I set table.setItemCount only to the value of the elements I already have in memory?



Regards,
Markus
Re: Lazy loading problem [message #764649 is a reply to message #763150] Mon, 12 December 2011 15:36 Go to previous message
Lakshmi Shanmugam
Messages: 274
Registered: July 2009
Location: India
Senior Member
Hi,

See this useful article on Virtual Tree & Table --> http://eclipse.org/articles/Article-SWT-Virtual/Virtual-in-SWT.html

After an item has been initialized, the SWT.SetData listener is not called to set its data again. But when the item is cleared with Table.clear() the listener will be called to set its data again as necessary.


Lakshmi P Shanmugam
Previous Topic:Not able to paste Ms-Excel column into SWT's Text widget
Next Topic:Eclipse taking breaks under Mac OS 10.7 Lion
Goto Forum:
  


Current Time: Wed Sep 17 11:38:01 GMT 2014

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

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