Community
Participate
Working Groups
The current 'createGui(MUIElement element, Object parent)' should have a third element which is the parent context within which the rendering should happen. The idea of that API is to be able to render 'local' elements (i.e. ones that aren't directly connected to the model such as an MPart in a dialog...). When I tried to do this with an MToolControl we ended up with a 'null' parent context because the model element really has no parent (its 'eContainer' is null). This would require a change to the IPresentationEngine's API but I think it's well worth it.
The other idea that comes to my mind is to add an Dialog-Element to our model which would act as the container. Dialogs are themselves children of a Window.
... beside that I guess we don't have too many customers yet for the PresentationEngine, so its unlikely we break existing customers
After having discussed this with Eric on IRC I'm +1 if this makes implementing the MToolControl, ... easier. I'd still like us to think about the MDialog proposal to bring the Dialogs into our Model (probably it could help us with Keybindings, ...?)
Created attachment 173477 [details] Extend createGui with a third parameter 'parentContext' I've scraped all of the code that I can see but there may be other bundles that were using the old API. If so you are likely ok to pass null unless the element you're creating *is* an MContext. If the element you're calling creatGui on is in the model structure then you should also be able to use the EModelService's context methods to determine the correct parent context for the element you're trying to render and pass it.
Committed in >20100705. Applied the patch.
Note that the above fix is only partial. It moves what we had over to using the new API but the various renderers are still using code to 'find' the parent context rather than using the one originally supplied to the 'createGui' call). Eventually we should have *no* renderer that uses anything except what gets passed in to it...
(In reply to comment #5) > Committed in >20100705. Applied the patch. Marking as fixed.
(In reply to comment #6) > Note that the above fix is only partial. Filed bug 320830 for this.