Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » HELP with HTML in SWT?
HELP with HTML in SWT? [message #467150] Wed, 25 January 2006 19:31 Go to next message
Adam Kumpf is currently offline Adam KumpfFriend
Messages: 14
Registered: July 2009
Junior Member
I have a canvas with a lot of user created objects and I'd like to add
text as well. In particular, I'd like to render HTML.

Since this is surely a common task in quite a few applications, I am
hoping there is a fairly straight forward way to take in an HTML file as a
string, and get the characters and the associated
style(font,bold,color,etc.) at each point in the document (in SWT). The
reason I prefer a method like this over StyledText is that I want to be
able to easily save the data and render it in a browser at some point down
the road. I also plan to do my own painting of the text since I require
transparency.

Thanks so much.

- Adam
Re: HELP with HTML in SWT? [message #467280 is a reply to message #467150] Fri, 27 January 2006 16:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kwpeck.mersoft.com

I kind of depends on how fancy your HTML will be. The FormText control
can handle various things but it is _not_ a full HTML rendering engine.
The nice thing is it will work on all supported platforms.

Your other choice, especially if you only care about Windows, is to use
the full browser control.

I have not done anything with transparency so I don't know if FormText
will help you in that area or not.

Adam Kumpf wrote:
>
> I have a canvas with a lot of user created objects and I'd like to add
> text as well. In particular, I'd like to render HTML.
> Since this is surely a common task in quite a few applications, I am
> hoping there is a fairly straight forward way to take in an HTML file as
> a string, and get the characters and the associated
> style(font,bold,color,etc.) at each point in the document (in SWT). The
> reason I prefer a method like this over StyledText is that I want to be
> able to easily save the data and render it in a browser at some point
> down the road. I also plan to do my own painting of the text since I
> require transparency.
>
> Thanks so much.
>
> - Adam
>
>
>
Re: HELP with HTML in SWT? [message #467328 is a reply to message #467280] Sat, 28 January 2006 23:15 Go to previous message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
The full browser control works on all supported platforms with the exception of certain circumstances on Linux (Mozilla GRE is required to be referenced in GRE_PATH). Look up the SWT FAQ for more information. The major disadvantages for what it sounds like you're doing are a) slower load time since you have to load the entire GRE, and b) it looks like a separate StyledText widget and not like embedded HTML.

If you're doing simple HTML I actually recomend that you write your own renderer to render onto a Label using the new 3.2 styling features. There are a myriad of HTML parsers out there, take your pick.
Previous Topic:How to create custom file dialog
Next Topic:FormToolkit working in a standalone SWT/Jface app?
Goto Forum:
  


Current Time: Thu May 23 07:13:43 GMT 2019

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

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

Back to the top