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 ShanmugamFriend
Messages: 275
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:Default size of a Composite
Next Topic:How associate a combo in a TableItem in a Table
Goto Forum:
  


Current Time: Sun Oct 22 14:04:49 GMT 2017

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

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