Skip to main content



      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 06:20 Go to next message
Eclipse UserFriend
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 06:45] by Moderator

Re: Clearing cached elements in virtual table [message #657667 is a reply to message #657302] Thu, 03 March 2011 10:38 Go to previous message
Eclipse UserFriend
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:[databinding] How to validate multiple properties cross-referenced
Goto Forum:
  


Current Time: Tue Jul 22 15:19:45 EDT 2025

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

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

Back to the top