|
Re: How to get a corresponding view to an element [message #520220 is a reply to message #520023] |
Thu, 11 March 2010 15:28 |
|
Hi Pavol,
I think you should better put the creation of your second D into your DEditHelper (which you perhaps have to create and register).
This is where "i-have-to-do-something-if-something-else-is-changed"-operations should generally be put.
Besides you only have to create the model-element of D and add it to the right containment-feature. GMF will handle the creation of the EditPart and therefore of the View on its own.
If that doesn't help you:
There is a findEditPart-method in each GraphicalEditPart. So, if you can somehow get the A-EditPart (EditPartRegistry??), you can get the B-EditPart and from that the B-View.
Regards
Matthias
http://www.horus.biz
|
|
|
Re: How to get a corresponding view to an element [message #520239 is a reply to message #520220] |
Thu, 11 March 2010 16:39 |
Pavol Messages: 4 Registered: March 2010 |
Junior Member |
|
|
Matthias M. wrote on Thu, 11 March 2010 16:28 |
I think you should better put the creation of your second D into your DEditHelper (which you perhaps have to create and register).
This is where "i-have-to-do-something-if-something-else-is-changed"-operations should generally be put.
|
Thanks, I will try it, but I think that there will always be the problem with getting the right view.
Matthias M. wrote on Thu, 11 March 2010 16:28 |
Besides you only have to create the model-element of D and add it to the right containment-feature. GMF will handle the creation of the EditPart and therefore of the View on its own.
|
I think, you are wrong here. I already tried this. I created model-element through MyDiagramFactory.eINSTANCE.createD() and then I set the containment-feature. Well - GMF created the model-element and also the View properly. But I guess, there is something wrong with the View serialization. Because if I close and re-open the editor, the View will not be constructed properly again. Therefore I suppose that the View have to be created with appropriate method from the class MyDiagramViewProvider.
Matthias M. wrote on Thu, 11 March 2010 16:28 |
If that doesn't help you:
There is a findEditPart-method in each GraphicalEditPart. So, if you can somehow get the A-EditPart (EditPartRegistry??), you can get the B-EditPart and from that the B-View.
|
I don't know how to get EditPartRegistry. But I will keep trying ...
Thanks.
Pavol.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02969 seconds