[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: Indention when using images in TreeViewer

This is the standard operating system behavior. If you want to go to the trouble, you could override it using owner draw:

http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/OwnerDrawLabelProvider.html

Matthew

Ricky Patel wrote:
I have a TreeViewer of which the children elements will have images but the parent elements will not (they receive null as an image). I've noticed that when the children elements are not shown, the tree looks like the following:

Parent1
Parent2

But then when I expand the tree the parent item is given space for an icon though it does not have one so the tree looks like this:


Parent 1
     (icon) Child 1
     (icon) Child 2
Parent 2
     (icon) Child 1
     (icon) Child 2

Is there anyway to not have this extra indention of space? Is this a flaw in ILabelProvider or is it how ILabelProvider is supposed to react? I assumed that the following would have happened instead...

Parent 1
 (icon) Child 1
 (icon) Child 2
Parent 2
 (icon) Child 1
 (icon) Child 2