TreeViewer: Updating the icon on expand/collapse [message #512451] |
Fri, 05 February 2010 03:27  |
Eclipse User |
|
|
|
Originally posted by: Raajesh.Kashyap.ext.ugs.com
I have a TreeViewer, whose label provider supplies a folder icon for the
folder nodes being displayed in the tree.
We have a requirement that when the folder node is expanded, the icon
against it must change to an expanded folder icon. I could not find how
I can make the label provider do this. There is no hook I could find to
trigger the label provider to provide an updated icon. I do not want to
refresh the node - just need the icon to be updated on expand.
Is there any way to accomplish this?
I am using Eclipse 3.5, but may need this for 3.2 and 3.3 (on which our
product is supported as well).
|
|
|
|
Re: TreeViewer: Updating the icon on expand/collapse [message #512467 is a reply to message #512466] |
Fri, 05 February 2010 04:05  |
Eclipse User |
|
|
|
Ups this doesn't work on 3.2 there you need to restore this expansion
state in your domain model because the labelprovider has no idea of the
item it is just updating.
Tom
Am 05.02.10 10:03, schrieb Tom Schindl:
> Use a ColumnLabelProvider (or CellLabelProvider) overwrite
> update(ViewerCell) and check there if the item is expanded, attach an
> expand/collapse listener on the Tree and call
> Viewer#update(item.getData()) in the listener.
>
> Tom
>
> Am 05.02.10 09:27, schrieb Raajesh B.Kashyap:
>> I have a TreeViewer, whose label provider supplies a folder icon for the
>> folder nodes being displayed in the tree.
>>
>> We have a requirement that when the folder node is expanded, the icon
>> against it must change to an expanded folder icon. I could not find how
>> I can make the label provider do this. There is no hook I could find to
>> trigger the label provider to provide an updated icon. I do not want to
>> refresh the node - just need the icon to be updated on expand.
>>
>> Is there any way to accomplish this?
>>
>> I am using Eclipse 3.5, but may need this for 3.2 and 3.3 (on which our
>> product is supported as well).
>
|
|
|
Powered by
FUDForum. Page generated in 0.04690 seconds