| Summary: | Make renderer factory configurable | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] e4 | Reporter: | Thomas Schindl <tom.schindl> | ||||||
| Component: | UI | Assignee: | Project Inbox <e4.ui-inbox> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | bokowski, emoffatt, laluz, Lars.Vogel, pwebster, remy.suen, yves.yang | ||||||
| Version: | 1.0 | ||||||||
| Target Milestone: | 1.0 RC0 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
This patch makes the extension point and the contribution bundle need less. Created attachment 169538 [details]
Updated Patch
Yves, I think I saw that you are setting your own RendererFactory in the Desginer code. Once I'll release this change you need to react on it. released changes to CVS There is an error in the constructor of the class PartRenderingEngine:
@Inject
public PartRenderingEngine(
@Named(E4Workbench.RENDERER_FACTORY_URI) @Optional String factoryUrl) {
if (factoryUrl == null) {
factoryUrl = defaultFactoryUrl;
}
this.factoryUrl = defaultFactoryUrl;
}
The this.factoryUrl is always initialized by defaultFactoryUrl. The argument is never used. I think the correct code should be:
@Inject
public PartRenderingEngine(
@Named(E4Workbench.RENDERER_FACTORY_URI) @Optional String factoryUrl) {
if (factoryUrl == null) {
factoryUrl = defaultFactoryUrl;
}
this.factoryUrl = factoryUrl;
}
I'll commit this correction with my update of Visual Design Editor.
VDE is updated. Thanks for catching this, Yves! factoryUrl is null, even if I specify the property "rendererFactoryUri".
For an easy test you can set the rendererFactoryUri to the standard factory and see that the factoryUrl is still null in PartRenderingEngine. I tried to debug this but the DI framework did not reveal it secrets to me.
This is the property:
<property
name="rendererFactoryUri"
value="platform:/plugin/org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.WorkbenchRendererFactory">
</property>
This is the part to check:
public PartRenderingEngine(
@Named(E4Workbench.RENDERER_FACTORY_URI) @Optional String factoryUrl) {
if (factoryUrl == null) {
factoryUrl = defaultFactoryUrl;
}
Looks like we forgot to set it into the context - fixed setting the url into the root-context when starting up. Thanks Tom, that was fast. Which plugin do I need to update to check (my internet connection is extremely slow at the moment)? org.eclipse.e4.ui.workbench.swt Sorry, but after an update of org.eclipse.e4.ui.workbench.swt from cvs factoryUrl is still null. Sorry, my error. Fixed with the change in EApplication.java. Thanks again Tom. |
Created attachment 169537 [details] Patch We should use DI to create the IRendererFactory (this would remove the need for the init()-method in the interface) and allow the user/developer to configure it when creating an application and/or launching. The patch attached implements this and allows the user/developer to customize it passing the uri to the renderer factory