Hi!

What UI component should be used to display text that is formatted by
spaces and newlines?

Label converts all white space as we know...

For example:

foo bar        baz

baz-bar      foo

I think that using a HTML element and "manually" escape the possible
HTML tags is unclean and inelegant.

I found this suggestion here*:

DOM.setStyleAttribute(theLabel.getElement(), "whiteSpace", "pre");
// and devised this hopefully equivalent solution**
theLabel.getElement().getStyle().setProperty("whiteSpace", "pre");

Any suggestions, comments?


* - 
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/abc75b44567812ea/2cce7ad404c998b9

** - the second throws  java.lang.IncompatibleClassChangeError: Found
interface com.google.gwt.user.client.Element, but class was expected
after I change the code in Eclipse while debugging (even for changing
java comments)
and retriggers the code (by clicking a button in my web page),
similar as in this issue: 
http://code.google.com/p/google-web-toolkit/issues/detail?id=5252


Regards,
David

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to