0

is there a way to assign an icon with the size of 32*16 instead of 16*16 to a treeviewer item? Another way would be to add two icon side by side at an item. Like the CheckboxTreeViewer, which has also two Icons (the checkbox and the item icon) side by side.

Has anyone an Idea how to do this?

Cheers, Phil

ph09
  • 1,052
  • 2
  • 20
  • 31

1 Answers1

0

If you use a label provider derived from org.eclipse.jface.viewers.OwnerDrawLabelProvider you can draw whatever you like in the rows.

OwnerDrawLabelProvider requires you to erase, measure and paint each row yourself using GC based operations.

It supports tool tips through getToolTipText(Object) (also tool tip fonts, color, time out).

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • At the moment I'm using a ColorProvider. So I've completely change to OwnerDrawLabelProvider? Will it work in the same way like the normal labelprovider (getImage, getText..)? And will it support Tooltips? – ph09 Nov 18 '13 at 17:23
  • Hmm, painting all by myself sounds like a lot of work, so this isn't then really an option for me. I'm wondering that there is no native support for TreeViewers.. – ph09 Nov 18 '13 at 18:08