Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Clearing cached elements in virtual table(table.setItemCount(0) does not clear cached elements)
Clearing cached elements in virtual table [message #657302] Wed, 02 March 2011 11:20 Go to next message
manasa  is currently offline manasa
Messages: 32
Registered: October 2010
Member
Hi,

I am making use of a virtual table to hold and display a huge result set which is around 7lacs.
And later I try to reset the table to its initial state releasing the 7lac result set using the following code.

tv.getTable().clearAll();
tv.getTable().setItemCount(0);


Ideally setItemCount() should clear the existing cache, as it is setting the cache size to 0.
But I still see the cachedelements holding the huge resultset resulting in performance issues.

Could any clarify how to clear the cached elements in a virtual table.
Thanks in advance,

Regards,
Manasa

[Updated on: Wed, 02 March 2011 11:45]

Report message to a moderator

Re: Clearing cached elements in virtual table [message #657667 is a reply to message #657302] Thu, 03 March 2011 15:38 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2151
Registered: July 2009
Senior Member
Hi Manasa,

Table.clearAll() is the correct way to do this at the swt level. To verify
that this is working in your environment you can take
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet144 .java
and add a block like the one below that calls clearAll(), then see that the
SetData listener starts being invoked again on items already shown.

table.addListener(SWT.MouseDoubleClick, new Listener() {
public void handleEvent(Event event) {
table.clearAll();
System.out.println("CLEAR ALL!");
}
});

I don't know the jface level too well, but since you're using TableViewer on
top of Table, maybe this needs to be done at the TableViewer level instead?
Does
http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.jface. snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippe ts/viewers/Snippet030VirtualLazyTableViewer.java?revision=1. 2&view=markup
give any useful clues?

Grant


"manasa" <manasa.priya.c@sap.com> wrote in message
news:ikl8oo$n3v$1@news.eclipse.org...
> Hi,
>
> I am making use of a virtual table to hold and display a huge result set
> which is around 7lacs.
> And later I try to reset the table to its initial state releasing the 7lac
> result set using the following code.
>
>
> tv.getTable().clearAll();
> tv.getTable().setItemCount(0);
>
>
> Ideally setItemCount() should clear the existing cache, as it is setting
> the cache size to 0.
> But I still see the cachedelements holding the huge resultset resulting in
> performance issues.
>
> Could any clarify how to clear the cached elements in a virtual table.
> Thanks in advance,
>
> Regards,
> Manasa
Previous Topic:Databinding custom cell editor
Next Topic:Forward keypress event to cell editor
Goto Forum:
  


Current Time: Thu Sep 18 20:01:01 GMT 2014

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

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