Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Long cells in table/tree - truncate from left?
Long cells in table/tree - truncate from left? [message #640879] Tue, 23 November 2010 12:55 Go to next message
Andrey is currently offline AndreyFriend
Messages: 10
Registered: May 2010
Junior Member

I've got an SWT Table or Tree and its cell values can be longer than cells widths. By default, no matter what text alignment in cell is, text is truncated from right, e.g. "Very long" will be truncated to "Very l...".

But for my values, the ending is the most important part. Is there a way I can make Table/Tree truncate text from the left, e.g. - "Very long" will be truncated to "...y long"?

Thanks in advance
Re: Long cells in table/tree - truncate from left? [message #641175 is a reply to message #640879] Wed, 24 November 2010 13:34 Go to previous message
Lakshmi ShanmugamFriend
Messages: 275
Registered: July 2009
Location: India
Senior Member

There is no SWT API to control which part of the text gets truncated. What you are seeing is the platform behavior and I'm not sure if Windows provides a way to control this.

I think you can try to do this use Custom drawing though. You can prevent the native text drawing and then draw your own text with the ellipsis.
Useful Article on Custom Drawing --> tomDrawingTableAndTreeItems/index.html
You can find example snippets on custom drawing here -->


Lakshmi P Shanmugam
Previous Topic:Mouse Event Zones On Canvas
Next Topic:Drawing a border around a Combo
Goto Forum:

Current Time: Fri Sep 21 14:30:11 GMT 2018

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

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

Back to the top