|Re: JS-libraries in custom widgets [message #1001766 is a reply to message #1001242]
||Thu, 17 January 2013 10:39
| Tim Buschtoens
Registered: July 2009
> How would I best integrate a js-library like ckeditor consisting of
> various js-files, css-files and images?
I'll assume we are talking about RAP 2.0.
There are three ways to register the resources: The
ApplicationConfiguration (non-workbench applications only), the
org.eclipse.rap.ui.resources extension point (workbench applications
only) or using the ResourceManager directly.
Using ApplicationConfiguration is simple, but then the resource
registration is part of your application instead of your custom widget.
Using the ResourceManager (e.g. in the custom widgets constructor) is
more flexible. But then you need to check first if the resource is
already registered, so it's not registered multiple times.
You also need deliver the JS to the client (except when using the
service. Here it is not necessary to check if the content was already
> How would I best integrate a js-library like jquery which which would
> potentially be used by several of my custom widgets
I would suggest to have a separate bundle used by the custom widgets. It
ensure the library is registered and loaded on the client. The custom
widgets could then call something like: JQuery.ensure();
If you have trouble with the details, just ask me.
 application.addResource( name, loader );
 RWT.getResourceManager(), register, isRegistered, and getLocation
> Thanks in advance for any help or hints.
Professional services for RAP and RCP?
Powered by FUDForum
. Page generated in 0.02453 seconds