Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » How to get a diagram programmatically?
How to get a diagram programmatically? [message #685906] Mon, 20 June 2011 16:05 Go to next message
--alex--  is currently offline --alex-- Friend
Messages: 26
Registered: October 2009
Junior Member
Hi there,
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)?
Re: How to get a diagram programmatically? [message #686052 is a reply to message #685906] Tue, 21 June 2011 14:04 Go to previous messageGo to next message
Cedric Dumoulin is currently offline Cedric DumoulinFriend
Messages: 51
Registered: July 2009
Member
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 !).

Check http://wiki.eclipse.org/Papyrus_Developer_Guide/How_To_Code_Examples
to know how.

Hope this help,
Cedric
Re: How to get a diagram programmatically? [message #686449 is a reply to message #686052] Wed, 22 June 2011 09:02 Go to previous message
--alex--  is currently offline --alex-- Friend
Messages: 26
Registered: October 2009
Junior Member
Thanks Cedric,
I see this is a feature of the ISashWindowsContainer of Papyrus 0.8, unfortunately I'm bound to work on Papyrus 0.7.3 for the moment.
Previous Topic:How to add a stereotype to an element in an UML diagram
Next Topic:Adding a Symbol to the palette
Goto Forum:
  


Current Time: Tue Mar 19 10:51:12 GMT 2024

Powered by FUDForum. Page generated in 0.01437 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top