Displaying a RichTextEditor in a popup [message #51934] |
Thu, 10 July 2008 12:23 |
Aline Messages: 32 Registered: July 2009 |
Member |
|
|
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 :(
Can anyone help me ?
Thanks in advance !!
|
|
|
Re: Displaying a RichTextEditor in a popup [message #51989 is a reply to message #51934] |
Thu, 10 July 2008 13:58 |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
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_OpenSou rce/skyway/common/plugins/org.skyway.ui/src/org/skyway/ui/ri chtext>
If you want to check out the code, see the instructions here:
http://www.skywayperspectives.org/wiki/index.php/CVS_Reposit ory (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
|
|
|
|
|
Re: Displaying a RichTextEditor in a popup [message #52217 is a reply to message #52038] |
Fri, 18 July 2008 20:19 |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Aline wrote:
> Hi !
>
> This helped me a lot thx again.
> I still have a problem :$ It seems that adding a URL doesn't work
> perfectly (the display name is not displayed, unless some text was
> selected) and adding an image in the HTML view doesn't work either. I
> can't managed to test your plugin to see how it looked like so I don't
> know if you have the same problem or if I forgot sthg.
>
> Do you have the same pbs ?
Yes, I see the same problem with URLs unless I first select some text. I
don't know about images because I remove that toolbar button for our
application (we don't want the user inserting images).
Eric
|
|
|
|
Re: Displaying a RichTextEditor in a popup [message #52267 is a reply to message #52241] |
Mon, 21 July 2008 13:03 |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Aline wrote:
> Ok thank you. It comforts me ^^
> I created classes which extend from these actions so it resolved my
> problems.
Can you share the code that fixes the insert URL problem? After all, I
shared a bunch of code with you... :-)
The best option would be to open a bug report about the problem and
attach your code that fixes it to the bug report.
Eric
|
|
|
|
|
Re: Displaying a RichTextEditor in a popup [message #589896 is a reply to message #51934] |
Thu, 10 July 2008 13:58 |
Eric Rizzo Messages: 3070 Registered: July 2009 |
Senior Member |
|
|
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_OpenSou rce/skyway/common/plugins/org.skyway.ui/src/org/skyway/ui/ri chtext>
If you want to check out the code, see the instructions here:
http://www.skywayperspectives.org/wiki/index.php/CVS_Reposit ory (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
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05760 seconds