[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.epf] Re: Displaying a RichTextEditor in a popup

Aline wrote:
Hi !

I want to offer a rich text editor for some properties in a EMF-like editor. When the button "..." is pressed, a popup appears. I managed to display a rich text editor but when I add the richtexttoolbar (with the fillToolBar() method), it appears at the bottom :( Here is a part of my code :

RichTextEditor rte = new RichTextEditor(parent, SWT.NONE, jEditor.getEditorSite());
IRichText rt = rte.getRichTextControl();
RichTextToolBar rttb = new RichTextToolBar(parent, SWT.NONE, rt);
rte.fillToolBar(rttb);


In the API (v1.0), the RichTextEditor has only 2 parameters but in my plugin (v1.2), there are 3. Can it come from this ?

Moreover, the richtext object is very small and I want it to fill the popup dialog (horizontally). I thought this was due to the layout and the layout data so I tried many combinaisons but it didn't work :(

You can take a look at what we've done to use the rich text editor in a dialog. You can browse the package in our CVS repository: <http://www.skywayperspectives.org/fisheye/browse/CVS_OpenSource/skyway/common/plugins/org.skyway.ui/src/org/skyway/ui/richtext>


If you want to check out the code, see the instructions here: http://www.skywayperspectives.org/wiki/index.php/CVS_Repository (you want the plugin named org.skyway.ui)

The class to start with is RichTextEditDialog, but you'll probably need to look at some others in that project to get the full picture. Of particular interest is the subclass of RichTextEditor that I created to customize its appearance and behavior a little bit. That may or may not be useful to you - if not, you can just use the EPF RichTextEditor class without subclassing.

Hope this helps,
	Eric