I am generating some diagram elements with information based on the active diagram page.
I know that there is no problem to create model elements for the model resource but I need a way to create them also in the corresponding diagram (that is: based on information of the CompositeStructure diagram, add some elements in the ClassDiagram).
I am able to get the current editor and so the current diagram (and the the edit part and so on), but I am not able to select a different diagram, which could be closed or opened in a tab of the SashEditor in order to get the edit part I need to generate what I want.
Is there a way to programmatically change the current tab (or open a diagram)?
You can get the list of available diagrams, open them, close them and test if a diagram is opened.
You can also got the list of the currently open diagrams, and their associated IEditorPart.
Remember that a closed diagram has no associated IEditorPart (because it is closed !).