Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Re: SWT VIRTUAL Tree possible setItemCount optimization?
Re: SWT VIRTUAL Tree possible setItemCount optimization? [message #334202] Mon, 26 January 2009 15:30 Go to next message
Carolyn MacLeod is currently offline Carolyn MacLeodFriend
Messages: 149
Registered: July 2009
Senior Member
Yes, that should work, and it's legal. You say it does work - great!
cc'ing this response to eclipse.platform to answer your TreeViewer question.

Carolyn

"Bruno Medeiros" <bdom.pub+eclipseng@gmail.com> wrote in message
news:glkh5k$vap$1@build.eclipse.org...
> Hello. I've been building some components with an SWT VIRTUAL Tree. As you
> know, even with a VIRTUAL table the setItemCount() function does not take
> a constant or near-constant amount of time to process in some platforms.
> It particular, in Windows it is costly to do a setItemCount with a big
> number (upwards from 10000), even if those items are not visible, such as
> when being children of a collapsed parent.
> My question is if the following optimization is valid: Whenever you have a
> collapsed parent with a big number of children, instead of setting the
> item count of that parent to the real number of children, you just set it
> to 1 (so that the expand toggle appears). Then, you add an expand
> listener, and whenever said parent is expanded, you set the item count to
> the correct number.
> It seems to me it is perfectly legal to change the item count in this way,
> and my testing shows no problems, but I just wanted to confirm it. Also,
> if this is perfectly valid, why doesn't TreeViewer employ this
> optimization? It does make a lot of difference when you have a tree with
> several tree items which are collapsed but have a large number of
> children.
>
> Bruno Medeiros
Re: SWT VIRTUAL Tree possible setItemCount optimization? [message #334203 is a reply to message #334202] Mon, 26 January 2009 15:33 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Maybe because noone thought about it. Would you like to file a bug
against Platform-UI so we can see if integrating this in TreeViewer-code
is possible?

Tom

Carolyn MacLeod schrieb:
> Yes, that should work, and it's legal. You say it does work - great!
> cc'ing this response to eclipse.platform to answer your TreeViewer question.
>
> Carolyn
>
> "Bruno Medeiros" <bdom.pub+eclipseng@gmail.com> wrote in message
> news:glkh5k$vap$1@build.eclipse.org...
>> Hello. I've been building some components with an SWT VIRTUAL Tree. As you
>> know, even with a VIRTUAL table the setItemCount() function does not take
>> a constant or near-constant amount of time to process in some platforms.
>> It particular, in Windows it is costly to do a setItemCount with a big
>> number (upwards from 10000), even if those items are not visible, such as
>> when being children of a collapsed parent.
>> My question is if the following optimization is valid: Whenever you have a
>> collapsed parent with a big number of children, instead of setting the
>> item count of that parent to the real number of children, you just set it
>> to 1 (so that the expand toggle appears). Then, you add an expand
>> listener, and whenever said parent is expanded, you set the item count to
>> the correct number.
>> It seems to me it is perfectly legal to change the item count in this way,
>> and my testing shows no problems, but I just wanted to confirm it. Also,
>> if this is perfectly valid, why doesn't TreeViewer employ this
>> optimization? It does make a lot of difference when you have a tree with
>> several tree items which are collapsed but have a large number of
>> children.
>>
>> Bruno Medeiros
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: SWT VIRTUAL Tree possible setItemCount optimization? [message #334218 is a reply to message #334203] Mon, 26 January 2009 21:07 Go to previous message
Eclipse UserFriend
Originally posted by: bdom.pub+eclipseng.gmail.com

Tom Schindl wrote:
> Maybe because noone thought about it. Would you like to file a bug
> against Platform-UI so we can see if integrating this in TreeViewer-code
> is possible?
>
> Tom
>

Hum, I'm wasn't planning on using TreeViewer on this, but I opened a
request nonetheless:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=262430

Bruno
Previous Topic:If you use the Common Navigator please test with this weeks I-build
Next Topic:Problems with context classloader when running Eclipse as headless antRunner
Goto Forum:
  


Current Time: Mon Dec 30 17:21:10 GMT 2024

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

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

Back to the top