2

I'm using a SWT TreeViewer to show some paths, is it possible to trim the path string to insert "..." (points) when the path is too long a is not fully visible in the tree column?

Something like this:

enter image description here

Thanks in advance

Daniel Peñalba
  • 30,507
  • 32
  • 137
  • 219

2 Answers2

2

Ok, reading the TreeColumn code I have noticed that the TreeViewer add ellipsis (...) to the columns automatically, but only if the column index is > 0. So column 0 strings are not truncated.

Try all eclipse views that uses a TreeView.

Really I don't understand this behavior.

Daniel Peñalba
  • 30,507
  • 32
  • 137
  • 219
0

Yes, you can use DecoratingLabelProvider over the LabelProvider which shows full paths (which is presumably what you have at the moment).

Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
  • I'm not sure that this is what I'm looking for. I think that I'm looking an flag or setting in the TreeViewer that do this automatically. See my edits. – Daniel Peñalba Sep 26 '11 at 17:29