Re: SWT VIRTUAL Tree possible setItemCount optimization? [message #334202] |
Mon, 26 January 2009 15:30 |
Carolyn MacLeod 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 |
Thomas Schindl 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
------------------------------------------------------------ --------
|
|
|
|
Powered by
FUDForum. Page generated in 0.03604 seconds