Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » HTML WYSIWYG Editor(What is the best way to include a WYSIWYG HTML Editor in an SWT app?)
HTML WYSIWYG Editor [message #492318] Mon, 19 October 2009 22:29 Go to next message
No real name is currently offline No real nameFriend
Messages: 1
Registered: October 2009
Junior Member
What is the best way to include a WYSIWYG HTML Editor in an (ideally standalone) SWT application?

Ideally something similar to Swing's JEditorPane.

If there isn't an existing widget, any advice on third-party libraries or workarounds would be gratefully received.

Many thanks in advance

D
Re: HTML WYSIWYG Editor [message #492764 is a reply to message #492318] Wed, 21 October 2009 15:46 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi,

You can put the native browsers into design mode by executing some
javascript:

String type = browser.getBrowserType();
if (type.equals("ie")) {
// not sure why "document.designMode='On';" doesn't work for IE
browser.execute("document.body.contentEditable='true';");
} else {
browser.execute("document.designMode='On';");
}

Invoking Browser.getText() at any point gives you the resulting HTML when
using IE and Mozilla, but I notice that this still gives the original page
HTML content with Safari. Perhaps an alternate way to get the current HTML
would be to evaluate a javascript expression (eg.- for IE:
browser.evaluate("return document.documentElement.outerHTML;"), didn't try
the other browser types).

HTH,
Grant


<dale.lane@gmail.com> wrote in message
news:hbip8l$hp1$1@build.eclipse.org...
> What is the best way to include a WYSIWYG HTML Editor in an (ideally
standalone) SWT application?
>
> Ideally something similar to Swing's JEditorPane.
>
> If there isn't an existing widget, any advice on third-party libraries or
workarounds would be gratefully received.
>
> Many thanks in advance
>
> D
Previous Topic:Browser sessions get cleared
Next Topic:How to display Scrollable Table larger than Scrollable Composite
Goto Forum:
  


Current Time: Fri Mar 29 11:07:58 GMT 2024

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

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

Back to the top