Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Is there a way to remove the blank tree icon inserted when other tree nodes have an icon?
Is there a way to remove the blank tree icon inserted when other tree nodes have an icon? [message #555712] Fri, 27 August 2010 18:41 Go to next message
Tony is currently offline TonyFriend
Messages: 52
Registered: July 2009
Member
I want to create a tree 3 levels deep with the nodes at the first 2 levels
using no icons (so that the label text is as close as possible to the tree
expand icon) and the nodes at level 3 using icons. Does anyone know if this
is possible? Thanks.
Re: Is there a way to remove the blank tree icon inserted when other tree nodes have an icon? [message #555947 is a reply to message #555712] Mon, 30 August 2010 11:07 Go to previous messageGo to next message
Lakshmi ShanmugamFriend
Messages: 275
Registered: July 2009
Location: India
Senior Member
Hi,

You can do this using custom drawing. You can draw the image and the text for the TreeItems at level 3 in the PaintItem Listener (instead of setting the image to the TreeItem). And use EraseItem Listener to prevent the default text drawing.

Please see the example snippets on how to use the PaintItem and EraseItem Listener --
Snippet220
Snippet227

Also useful - Article on Custom drawing Tree and TableItems


Lakshmi P Shanmugam
Re: Is there a way to remove the blank tree icon inserted when other tree nodes have an icon? [message #557083 is a reply to message #555947] Sat, 04 September 2010 04:51 Go to previous message
Tony is currently offline TonyFriend
Messages: 52
Registered: July 2009
Member
Thanks this was exactly what I needed.
Previous Topic:Min size of a component? layout question
Next Topic:JavaDocs
Goto Forum:
  


Current Time: Wed Dec 13 11:30:41 GMT 2017

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

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