Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Avoid to trim text in AbstractTextPainter
Avoid to trim text in AbstractTextPainter [message #1625361] Fri, 20 February 2015 10:23 Go to next message
Michael Haus is currently offline Michael HausFriend
Messages: 1
Registered: February 2015
Junior Member

I want to display text with whitespace at the beginning, but the AbstractTextPainter omits all leading and trailing whitespace in the method
getTextToDisplay(..) > text = text.trim()

For testing purpose I created a new AbstractTextPainter identically to the original one, but I removed the trim. Now, all leading whitespaces of the text remain.

But I don't want a custom AbstractTextPainter with that small change. Is there another possiblity to maintain leading whitespaces of the input text? Or could you make a new option in the AbstractTextPainter to enable/disable text trimming, like:

public AbstractTextPainter(boolean keepWhitespace, ...) { ... }

getTextToDisplay(keepWhitespace, ...) { if (keepWhitespace) text = text.trim ... }

Best Regards,
Re: Avoid to trim text in AbstractTextPainter [message #1625690 is a reply to message #1625361] Fri, 20 February 2015 15:18 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
1. Create an enhancement ticket in Bugzilla
2. Implement the change
3. Contribute the change via Gerrit

I would prefer a member variable with getters and setters instead of another constructor parameter.
Previous Topic:Sort / Filter problem using Glazedlists
Next Topic:Difference between region labels and config labels?
Goto Forum:

Current Time: Fri Mar 05 20:44:07 GMT 2021

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

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

Back to the top