|
Re: Generate diagram instance from ecore-instance [message #642954 is a reply to message #642947] |
Fri, 03 December 2010 13:56 |
Michael Golubev Messages: 383 Registered: July 2009 |
Senior Member |
|
|
Hello,
You would have to reimplement a lot of the logic which is spread over the diagram code in both generated plugin and runtime plugins.
However, I don't really understand why do you need the component like that. If you just setup the Diagram instance (linking it to the correct semantic element), then the very first opening of the diagram by the user will create all inner structure automatically. You can test it by removing all but the diagram element from existing *.model_diagram file and reopening the editor.
If that does not help and if you are brave enough, you may try to write code around:
- manually creating the Diagram instance by calling the XXXDiagramEditorUtil#createDiagram()
- iteratively calling the XXXDiagramUpdater#getSemanticChildren(View) to create the nodes structure first,
- calling the ViewService for each XXXNodeDescriptor collected from diagram updater to invoke creation of the compartments, labels and other staff implicitly added in the XXXViewProvider
- finally calling the code similar to <Diagram>CanonicalEditPolicy#collectAllLinks(..), and again, wrapping the XXXLinkDescriptors into Edge's by calling the ViewService.
But I would not try to do that myself without a really good reason.
Regards,
Michael
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03382 seconds