HTML text rendering in a text widget (like JLabel in Swing)? [message #461263] |
Mon, 19 September 2005 18:27  |
Eclipse User |
|
|
|
Hey all,
I have a string that contains HTML text formating tags, such as bold,
italic and line break and would like to display the properly formatted
string in a SWT app.
After searching around and asking some people, I haven't found any SWT
widget that makes this easy, like JLabel in Swing. For instance, I've found
that I can use StyledText/StyleRange to display a string with different font
styles and colors, but getting StyleRange from HTML seems like it might be
difficult.
Before setting out on a difficult task of rolling my own, I want to make
sure there isn't something easy I'm overlooking. Any help?
Thanks,
Nadeem
|
|
|
Re: HTML text rendering in a text widget (like JLabel in Swing)? [message #461277 is a reply to message #461263] |
Tue, 20 September 2005 07:23   |
Eclipse User |
|
|
|
You could reuse the HTML2TextReader that Eclipse is using to render JavaDoc
in the Hovers.
It is using StyledText and StyleRanges as well and supports basic Font
styles
and paragraphs.
Ben
> Hey all,
>
> I have a string that contains HTML text formating tags, such as bold,
> italic and line break and would like to display the properly formatted
> string in a SWT app.
>
> After searching around and asking some people, I haven't found any SWT
> widget that makes this easy, like JLabel in Swing. For instance, I've found
> that I can use StyledText/StyleRange to display a string with different font
> styles and colors, but getting StyleRange from HTML seems like it might be
> difficult.
>
> Before setting out on a difficult task of rolling my own, I want to make
> sure there isn't something easy I'm overlooking. Any help?
>
> Thanks,
> Nadeem
>
>
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.24186 seconds