Skip to main content



      Home
Home » Modeling » Papyrus » Access Papyrus Uml model from Eclipse plugin
Access Papyrus Uml model from Eclipse plugin [message #1455466] Wed, 29 October 2014 07:58 Go to next message
Eclipse UserFriend
Hi,

I have a Papyrus project, that contains an UML modell with class diagram. I would like to access to the modell -number of classes, attributes, operations, etc.- from an Eclipse plugin. How can I do this? Where can I find some tutorials, example codes?
Thanks for your kind help,

Alex
Re: Access Papyrus Uml model from Eclipse plugin [message #1455531 is a reply to message #1455466] Wed, 29 October 2014 09:10 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alex,

Have a look here, https://wiki.eclipse.org/Papyrus_Developer_Guide/How_To_Code_Examples#How_to_Get_the_Current_Selection_from_Java_code

Regards
/Patrik
Re: Access Papyrus Uml model from Eclipse plugin [message #1462419 is a reply to message #1455531] Wed, 05 November 2014 10:03 Go to previous messageGo to next message
Eclipse UserFriend
Hi Patrik,

Thanks for the answer, it was helpfull. Using this guide, I can get the selected items from the graphical editor.

But how can I read the classes (and the attributes, operations of these) from the model without selecting anything in the editor?

[Updated on: Wed, 05 November 2014 10:03] by Moderator

Re: Access Papyrus Uml model from Eclipse plugin [message #1466970 is a reply to message #1462419] Sun, 09 November 2014 12:49 Go to previous messageGo to next message
Eclipse UserFriend
Do you mean how to get the currently loaded model in the model explorer? I would like to know that as well actually.
Re: Access Papyrus Uml model from Eclipse plugin [message #1468009 is a reply to message #1466970] Mon, 10 November 2014 08:57 Go to previous messageGo to next message
Eclipse UserFriend
Hi, Patrik,

The Model Explorer view is adaptable to the ServicesRegistry type,
which adapter then can provide the ModelSet as a service. The UmlModel
within the ModelSet knows the loaded UML model.

So, if you ask the workbench page for the explorer view by ID and do
getAdapter(ServicesRegistry.class) on that, you should get what you
need.

HTH,

Christian


On 2014-11-09 17:49:07 +0000, Patrik Nandorf said:

> Do you mean how to get the currently loaded model in the model
> explorer? I would like to know that as well actually.
Re: Access Papyrus Uml model from Eclipse plugin [message #1468389 is a reply to message #1468009] Mon, 10 November 2014 15:30 Go to previous message
Eclipse UserFriend
Hi Christian,

Great! Thanks!

/Patrik
Previous Topic:Custom palette association: init member ends name (empty) and show only if filled by the modeler
Next Topic:Open diagram programmatically
Goto Forum:
  


Current Time: Tue Jul 15 02:41:03 EDT 2025

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

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

Back to the top