Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Text widget messing up newlines
Text widget messing up newlines [message #806247] Fri, 24 February 2012 18:42 Go to next message
John Lussmyer is currently offline John LussmyerFriend
Messages: 100
Registered: December 2010
Senior Member
I have several Text widgets for entering and editing some data.
I've found that the newline handling seems to be just plain weird.
If you type multiple lines into a Text widget, then use .getText(), each newline is a "\r\n" - which is just fine.
If I then use .setText() to put that text into a Text field, then .getText() to get that text back out, the newlines have become "\r\r\n".

How can I prevent this?
Re: Text widget messing up newlines [message #806251 is a reply to message #806247] Fri, 24 February 2012 18:47 Go to previous messageGo to next message
John Lussmyer is currently offline John LussmyerFriend
Messages: 100
Registered: December 2010
Senior Member
Arrgghh!!! This happened several times in a row while debugging, and now it refuses to happen again.
Re: Text widget messing up newlines [message #806289 is a reply to message #806251] Fri, 24 February 2012 19:50 Go to previous message
John Lussmyer is currently offline John LussmyerFriend
Messages: 100
Registered: December 2010
Senior Member
Ok, I think I've figured out the requirements to cause it to happen.
You need to have a mixture of "\n" and "\r\n" in the text.
When you have a mixture, it converts ALL the "\n" into "\r\n" - including the ones that already have the "\r".
Previous Topic:Showing properties view
Next Topic:Setting Workspace Location
Goto Forum:
  


Current Time: Mon Nov 30 09:27:33 GMT 2020

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

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

Back to the top