Avoid to trim text in AbstractTextPainter [message #1625361] |
Fri, 20 February 2015 05:23  |
Eclipse User |
|
|
|
Hello,
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,
Michael
|
|
|
|
Powered by
FUDForum. Page generated in 0.21633 seconds