Avoid text wrapping in GridPrint cells.

14 views
Skip to first unread message

Beuck, Torsten

unread,
Mar 2, 2010, 5:36:18 AM3/2/10
to swt-pap...@googlegroups.com
Hi,

I like to use Paperclips to print SWT tables as the user sees them. That
especially means that cell content that is wider than the cell should be
truncated and optionally decorated with an ellipse. But GridPrint in
association with TextPrint seems to wrap text always into multiple lines
if the text is wider than the grid column. Is there a way to avoid this?

Regards,
Torsten

Matthew Hall

unread,
Mar 2, 2010, 9:35:35 AM3/2/10
to SWT PaperClips
There is nothing built in to accommodate this use case. The solution
is to effectively copy and paste the existing TextPrint class to you
own TruncatedTextPrint class and change it to truncate lines as you
require. Then modify your code to use that class instead of
TextPrint.

The main part to change is in TextIterator.nextLines. Let me know if
you need help.

Matthew

On Mar 2, 3:36 am, "Beuck, Torsten" <Torsten.Be...@ottogroup.com>
wrote:

Reply all
Reply to author
Forward
0 new messages