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
Hi,

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 P ShanmugamFriend
Messages: 279
Registered: July 2009
Location: India
Senior Member
Hi,

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 --> http://www.eclipse.org/articles/article.php?file=Article-Cus tomDrawingTableAndTreeItems/index.html
You can find example snippets on custom drawing here --> http://eclipse.org/swt/snippets/


HTH,


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


Current Time: Sat Apr 20 06:43:10 GMT 2024

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

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

Back to the top