开发者

SWT TreeViewer, trim string text in columns

开发者 https://www.devze.com 2023-04-07 11:21 出处:网络
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?

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:

SWT TreeViewer, trim string text in columns

开发者_开发技巧

Thanks in advance


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消