|Extending the RichTextEditor custom widget [message #1778605]
||Mon, 18 December 2017 15:26
| Gunnar Adams
Registered: May 2016
as I am still trying to improve the RichTextEditor widget which we are using in our application. This is a modified version of the original RAP one, where I have exchanged the CKEDITOR for version 4.6.2 (I did this some time ago) and added event handlers which notify the server widget counterpart about focus events. Also, I can set the focus into the control.
Now I have encountered the following problem:
It is a requirement in our application, that the look&feel of context menus is consistent across the application. The RichTextEditor context menu is one example where this does not work, because the CKEDITOR used internally has it's own ideas about the context menu.
I was able, though, to get a contextmenu event handler to work, which notifies me (or the server widget via notify()), when a context menu is to be shown. As our context menus are created by the server application, this is exactly what I want.
The problem is, that I have not yet figured out, how to dismiss the context menu again (based on a mousedown or ESC-Key event). Starting with the mouse events, I tried to submit the CompositeProxy which is the base for the RichTextEditor custom widget as a target for the MenuHandler.update() method, but this does not work. I suspect, that I need a "real" widget in order to do this!? as it is I get a new context menu every time I release the mouse button, but it is never removed when I click on the mouse inside the RichTextEditor.
It would be conveniant if there was some kind of function which could be used to construct an RWT event from a DOM event. Is there? It would have to be callable from a custom widget. It would also be nice if the standard event processing (EventHandlerUtil etc.) available for other widgets would be callable for custom widgets.
I understand, that rap.getObject always returns just a CompositeProxy and never the actual widget. Is this correct?
Thanks a lot for your input
Powered by FUDForum
. Page generated in 0.01922 seconds