Nebula Rich Text Editor in RAP

When you need rich text editing in a RAP application, things are getting easier. You may know that there is a RichText component in the RAP Incubator. It’s around for a long time and we found it’s time for this component to graduate.


Interestingly, the Nebula project also provides a RichText editor for SWT, that even works with RAP. Just like the CkEditor widget from the RAP Incubator, the Nebula RichTextEditor is based on CkEditor, a popular rich text editor for the Web. The Nebula widget actually wraps an SWT Browser widget which hosts the CkEditor.

However, even though this implementation can be used with RAP, it’s not the ideal combination, because of some limitations of the Browser widget in RAP. Namely, some Browser API is only available in SWT compatibility mode, so the Nebula widget won’t work in JEE mode. The widget from the RAP Incubator is a real custom widget, preferable over the Browser approach.

To make things simple, and to enable code re-use, we decided to make our rich text editor compatible with the Nebula API and incorporate it in the RAP runtime. As a result, a stable RichTextEditor widget will be included in the next milestone, RAP 3.1. M5, available Feb 5, 2016. You’ll find it in the package org.eclipse.nebula.widgets.richtext.

At the moment, only a subset of the Nebula RichText API is implemented. You can get and set the text and the editable state. Things like font and background can be set using the respective SWT methods. Support for customizing the editor toolbar is in the works.