StyledHtml
A WYSIWYG SWT editor component for standard HTML content. Implemented as a subclass of the standard StyledText component.
Features
- Lightweight, particularly as compared to full browser-based HTML editor implementations.
- Utilizes an Antlr-based HTML parser for fast conversion of HTML content to rich presentation.
- Capable of supporting reasonable implementation of a WYSIWYG HTML encoded text area, particularly when coupled with CssQuery and SwtSpell.
Development State
Currently in use as the main editing component for JDocEditor. Handles a fairly wide range of HTML.
Use
For presentation, just use the standard StyledText attributes.
StyledHtml#setHtml used to insert text. The given text will be treated as parseable HTML if the given text starts with "<!--", "<html>", or "<body>". If not, the given text is treated as plain text and wrapped in <body> tags to create parseable content. Regardless, any embedded, properly formed HTML tags will be parsed for presentation.
StyledHtml#getHtml used to get the full HTML content of the held by the control.
StyledHtml#setText same as StyledHtml#setHtml.
StyledHtml#getText used to retrieve the plain text equivalent of the content held by the control. All HTML tags will be ommitted.
StyledHtmlMain a standalone SWT test program is included in the jar.
License
Available only under these terms:
- License: A personal right to use, as is, and nothing more.
- Warrantees: Absolutely none of any cognizable nature including MERCHANTABILITY and/or FITNESS FOR ANY GENERAL OR SPECIFIC PURPOSE OR USE. In fact, be forewarned that use of this software will likely cause failures and result in the loss of data.
- If you use this software, then you agree to these terms.