Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Finding name of image of a selected treeItem
Finding name of image of a selected treeItem [message #466172] Wed, 04 January 2006 13:41 Go to next message
mp is currently offline mpFriend
Messages: 8
Registered: July 2009
Junior Member
How can I get the name of an Image of a certain treeItem in a tree.
For an item that gets selected I want to verify if a centain image with a
specific name was set?
Re: Finding name of image of a selected treeItem [message #466176 is a reply to message #466172] Wed, 04 January 2006 14:48 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
You could use TreeItem.setData(key, value) to store the image name when
setting the image so that you can compare later on using
TreeItem.getData(key).

"mp" <pijnmar@home.nl> wrote in message
news:f54b94814d2efaadaf5443a90fa92278$1@www.eclipse.org...
> How can I get the name of an Image of a certain treeItem in a tree.
> For an item that gets selected I want to verify if a centain image with a
> specific name was set?
>
Re: Finding name of image of a selected treeItem [message #466180 is a reply to message #466176] Wed, 04 January 2006 17:09 Go to previous messageGo to next message
mp is currently offline mpFriend
Messages: 8
Registered: July 2009
Junior Member
Perfect.

As I never used this. What is the normal usage for this function? Must I
see it as an enhanced option to "tag" an item with objects...
Re: Finding name of image of a selected treeItem [message #466244 is a reply to message #466180] Thu, 05 January 2006 13:51 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
It is just a simple mechanism to associate data with a widget. For example,
if I have a Tree representing files and directories in the file system I
might associate a Java File object with each item in the Tree. The Tree
displays the name and icon for the file but if I want access to more
information about the file, I get the associated File object.

"mp" <pijnmar@home.nl> wrote in message
news:a4967a5731c5b75b73479b910b71e46a$1@www.eclipse.org...
> Perfect.
> As I never used this. What is the normal usage for this function? Must I
> see it as an enhanced option to "tag" an item with objects...
>
Previous Topic:Problem making a view scrollable
Next Topic:How to combine different images to one image?
Goto Forum:
  


Current Time: Sat Sep 21 12:56:08 GMT 2019

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

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

Back to the top