Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Access Papyrus Uml model from Eclipse plugin
Access Papyrus Uml model from Eclipse plugin [message #1455466] Wed, 29 October 2014 11:58 Go to next message
Alex T. is currently offline Alex T.Friend
Messages: 2
Registered: October 2014
Junior Member
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 13:10 Go to previous messageGo to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 169
Registered: January 2013
Location: Sweden
Senior Member
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 15:03 Go to previous messageGo to next message
Alex T. is currently offline Alex T.Friend
Messages: 2
Registered: October 2014
Junior Member
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 15:03]

Report message to a moderator

Re: Access Papyrus Uml model from Eclipse plugin [message #1466970 is a reply to message #1462419] Sun, 09 November 2014 17:49 Go to previous messageGo to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 169
Registered: January 2013
Location: Sweden
Senior Member
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 13:57 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1206
Registered: July 2009
Location: Canada
Senior Member

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 20:30 Go to previous message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 169
Registered: January 2013
Location: Sweden
Senior Member
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: Sat Jul 11 19:03:28 GMT 2020

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

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

Back to the top