Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » changing icons in a tree
changing icons in a tree [message #460728] Tue, 06 September 2005 03:14 Go to next message
Pete is currently offline PeteFriend
Messages: 26
Registered: July 2009
Junior Member
Hi, guys!
how do I change icons in a TreeViewer class? For example, if the node is collapsed, one icon is displayed, if expanded other.
thanks for your advice in advance.
Re: changing icons in a tree [message #460731 is a reply to message #460728] Tue, 06 September 2005 08:19 Go to previous messageGo to next message
Stefan Langer is currently offline Stefan LangerFriend
Messages: 236
Registered: July 2009
Senior Member
You have to implement an ILabelProvider. Look at ILabelProvider,
LabelProvider in help.

Regards
Stefan

Pete wrote:
> Hi, guys!
> how do I change icons in a TreeViewer class? For example, if the node is collapsed, one icon is displayed, if expanded other.
> thanks for your advice in advance.
Re: changing icons in a tree [message #460733 is a reply to message #460728] Tue, 06 September 2005 10:58 Go to previous messageGo to next message
Pete is currently offline PeteFriend
Messages: 26
Registered: July 2009
Junior Member
yep, I know I have to implement this stuff, otherwise nothing would work. But could you be more specific?
Re: changing icons in a tree [message #460735 is a reply to message #460733] Tue, 06 September 2005 12:26 Go to previous messageGo to next message
Robert Bacs is currently offline Robert BacsFriend
Messages: 165
Registered: July 2009
Senior Member
Put this in your LabelProvider:

public Image getImage(Object element){
return treeViewer.getExpandedState(element) ? expandedImage :
collapsedImage;
}

"Pete" <peter_ossipov@mail.ru> wrote in message
news:29263364.1126004333493.JavaMail.root@cp1.javalobby.org...
> yep, I know I have to implement this stuff, otherwise nothing would work.
But could you be more specific?
Re: changing icons in a tree [message #460777 is a reply to message #460728] Wed, 07 September 2005 03:41 Go to previous message
Pete is currently offline PeteFriend
Messages: 26
Registered: July 2009
Junior Member
oh, right! thanks a lot!
Previous Topic:brain fog with building a jface tree viewer
Next Topic:editing node names in a tree using TreeViewer
Goto Forum:
  


Current Time: Wed Jun 19 16:48:40 GMT 2019

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

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

Back to the top