Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EPF » Displaying a RichTextEditor in a popup
Displaying a RichTextEditor in a popup [message #51934] Thu, 10 July 2008 12:23 Go to next message
Aline is currently offline AlineFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #52013 is a reply to message #51989] Thu, 10 July 2008 14:33 Go to previous messageGo to next message
Aline is currently offline AlineFriend
Messages: 32
Registered: July 2009
Member
woooow thx a lot !! ^___^
Re: Displaying a RichTextEditor in a popup [message #52038 is a reply to message #52013] Tue, 15 July 2008 10:26 Go to previous messageGo to next message
Aline is currently offline AlineFriend
Messages: 32
Registered: July 2009
Member
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 ?

Thx
Re: Displaying a RichTextEditor in a popup [message #52217 is a reply to message #52038] Fri, 18 July 2008 20:19 Go to previous messageGo to next message
Eclipse UserFriend
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 #52241 is a reply to message #52217] Mon, 21 July 2008 06:56 Go to previous messageGo to next message
Aline is currently offline AlineFriend
Messages: 32
Registered: July 2009
Member
Ok thank you. It comforts me ^^
I created classes which extend from these actions so it resolved my
problems.

Thx again !
Re: Displaying a RichTextEditor in a popup [message #52267 is a reply to message #52241] Mon, 21 July 2008 13:03 Go to previous messageGo to next message
Eclipse UserFriend
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 #52293 is a reply to message #52267] Mon, 21 July 2008 14:24 Go to previous messageGo to next message
Aline is currently offline AlineFriend
Messages: 32
Registered: July 2009
Member
Hi,

It's my first time so maybe some infos are missing ^^!

Here is the link : https://bugs.eclipse.org/bugs/show_bug.cgi?id=241541

I hope this will help you ^_^
Re: Displaying a RichTextEditor in a popup [message #52319 is a reply to message #52293] Mon, 21 July 2008 20:17 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Aline wrote:
> Hi,
> It's my first time so maybe some infos are missing ^^!
>
> Here is the link : https://bugs.eclipse.org/bugs/show_bug.cgi?id=241541
>
> I hope this will help you ^_^
>

Thank you very much for giving back to the community! Whomever is
assigned to look into the problem may request more information or some
changes to the code, but this is an excellent start.

Eric
Re: Displaying a RichTextEditor in a popup [message #589896 is a reply to message #51934] Thu, 10 July 2008 13:58 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 2409
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
Re: Displaying a RichTextEditor in a popup [message #589904 is a reply to message #51989] Thu, 10 July 2008 14:33 Go to previous message
Aline is currently offline AlineFriend
Messages: 32
Registered: July 2009
Member
woooow thx a lot !! ^___^
Re: Displaying a RichTextEditor in a popup [message #589912 is a reply to message #52013] Tue, 15 July 2008 10:26 Go to previous message
Aline is currently offline AlineFriend
Messages: 32
Registered: July 2009
Member
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 ?

Thx
Re: Displaying a RichTextEditor in a popup [message #589959 is a reply to message #52038] Fri, 18 July 2008 20:19 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 2409
Registered: July 2009
Senior Member
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 #589968 is a reply to message #52217] Mon, 21 July 2008 06:56 Go to previous message
Aline is currently offline AlineFriend
Messages: 32
Registered: July 2009
Member
Ok thank you. It comforts me ^^
I created classes which extend from these actions so it resolved my
problems.

Thx again !
Re: Displaying a RichTextEditor in a popup [message #589977 is a reply to message #52241] Mon, 21 July 2008 13:03 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 2409
Registered: July 2009
Senior Member
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 #589983 is a reply to message #52267] Mon, 21 July 2008 14:24 Go to previous message
Aline is currently offline AlineFriend
Messages: 32
Registered: July 2009
Member
Hi,

It's my first time so maybe some infos are missing ^^!

Here is the link : https://bugs.eclipse.org/bugs/show_bug.cgi?id=241541

I hope this will help you ^_^
Re: Displaying a RichTextEditor in a popup [message #589992 is a reply to message #52293] Mon, 21 July 2008 20:17 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 2409
Registered: July 2009
Senior Member
Aline wrote:
> Hi,
> It's my first time so maybe some infos are missing ^^!
>
> Here is the link : https://bugs.eclipse.org/bugs/show_bug.cgi?id=241541
>
> I hope this will help you ^_^
>

Thank you very much for giving back to the community! Whomever is
assigned to look into the problem may request more information or some
changes to the code, but this is an excellent start.

Eric
Previous Topic:Experience with Subversion?
Next Topic:New build of EPF Practices available for download
Goto Forum:
  


Current Time: Fri Dec 19 11:57:18 GMT 2014

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

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