| Summary: | Custom Theming problem with the Lightweight OSGI setup for RAP | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Kees Pieters <info> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ivan, rsternberg |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Kees Pieters
I have done some further debugging, and I see now that the applicationLauncher.launch method is called twice. The first time from org.eclipse.rap.ui.internal.servlet.HttpServiceTracker which seems to work fine, and then from org.eclipse.rap.rwt.osgi.internal.ApplicationLauncherImpl, which does not seem to register the themes. Despite my previous post, this seems to happen in one sweep, so calling the servlet from the browser does not seem to matter. Probably you have a workbench bundle mistakenly selected in your launch configuration. In order to register custom theme in a lightweight application use: Application#addStyleSheet in your ApplicationConfiguration#configure method. @Ivan Even if this were the case, the second applicationcontext should still register the themes. We then would have a double applicationcontext -which is not very helpful- but they should still work correctly. I have found out by now that the lightweight RAP-osgi example results in a double call to org.eclipse.rap.rwt.osgi.internal.ApplicationReferenceImpl.start(); This results in two applicationRunners and two applicationContexts, which gives the afore mentioned problems. One applicationRunner is able to access the themes, the other does not. If I add the theme as you suggest, the FIRST themeManager is used (which already contains the theme) and therefore the method does not add the theme. What I mean to say, that there are still two applicationRunners active. I suspect the initial one is started with org.eclipse.rap.ui, which evidently takes care of the workbench manner of working. If I remove the references to this plugin in my launch configuration, I only get one applicationRunner. However, even in a lightweight osgi approach I would have no problem using extensions for themes and branding. The documentation also suggests that this should be done as well. I have seen no reference to Application#addStyleSheet in the docs I read so far. Besides this, if I use this method to add the stylesheet, then it does not become the currentTheme at runtime, so I still see the default theme. It's not possible to use the new OSGi API together with workbench/ui bundles (see bug 377414). Do the following: 1. Don't use workbench/ui bundles and extension points 2. Register your application with the new OSGi API 3. Register your custom theme with the new OSGi API 4. Start your application (In reply to comment #4) > However, even in a lightweight osgi approach I would have no problem using > extensions for themes and branding. The themes extension point is located in the bundle org.eclipse.rap.ui, which is part of the old eclipse 3.x stack (it depends on and re-exports the workbench). You can use the extension registry together with the new API, but not the old extension points. > The documentation also suggests that this > should be done as well. I have seen no reference to Application#addStyleSheet > in the docs I read so far. Besides this, if I use this method to add the > stylesheet, then it does not become the currentTheme at runtime, so I still see > the default theme. If the documentation is misleading, we should fix it. Which part are you referring to? Reopened by accident (In reply to comment #7) > Reopened by accident Hi Ralf, The errors are all mine ~). Being a newbie on RAP, I got confused with the various posts on the Internet regarding RAP. De development guide and the new and noteworthy listing on the RAP forums provide accurate info. Some other issues complicated stuff, but these are strictly speaking not part of the bug I reported. I would like to compliment all of the RAP developers on making a very professional application, kudoos! I think the main problem in the documentation is that when you start by setting up a light-weight osgi app, and then you move on to the RWT theming in the documentation, that things start to get mixed up. A note in that chapter, pointing to the programmatic inclusion of theme files, may be very helpful there. Hope this helps |