HTML text rendering in a text widget (like JLabel in Swing)? [message #461263] |
Mon, 19 September 2005 22:27 |
Nadeem Aboobaker Messages: 20 Registered: July 2009 |
Junior Member |
|
|
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 11:23 |
Benjamin Pasero Messages: 337 Registered: July 2009 |
Senior Member |
|
|
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
>
>
>
|
|
|
|
Re: HTML text rendering in a text widget (like JLabel in Swing)? [message #461290 is a reply to message #461263] |
Tue, 20 September 2005 12:54 |
Eclipse User |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
"Nadeem Aboobaker" <nadeem.aboobaker@bea.com> wrote in message
news:dgne1a$o33$1@news.eclipse.org...
> 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?
>
Why don't you just use the Browser widget?
Does the widget need to be editable?
---
Sunil
|
|
|
|
Powered by
FUDForum. Page generated in 0.04232 seconds