Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Find a view in diagram(s) for a semantic element?
Find a view in diagram(s) for a semantic element? [message #1725524] Fri, 04 March 2016 07:45 Go to next message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 169
Registered: January 2013
Location: Sweden
Senior Member
How can I find the view(s) in diagram(s) for a semantic element programmatically?

I guess I could load the notation model and search for the views matching the element but I guess/hope there is a better way.

Regards
Patrik

Re: Find a view in diagram(s) for a semantic element? [message #1725540 is a reply to message #1725524] Fri, 04 March 2016 09:24 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 926
Registered: February 2011
Senior Member
Hi Patrik,

You can use the CrossReferencer:

EObject semanticElement;
ECrossReferenceAdapter.getCrossReferenceAdapter(semanticElement).getInverseReferences(semanticElement);


This will return a list of Settings (EStructuralFeature, EObject) of all the eObjects referencing the semantic element. You can filter this list with (Setting.EObject instanceof View) and (Setting.EStructuralFeature == View#element)

The CrossReferencer in Papyrus relies on a Cache, so it should be more efficient than browsing the model manually

Regards,
Camille


Camille Letavernier
Re: Find a view in diagram(s) for a semantic element? [message #1725591 is a reply to message #1725540] Fri, 04 March 2016 15:41 Go to previous message
Patrik Nandorf is currently offline Patrik NandorfFriend
Messages: 169
Registered: January 2013
Location: Sweden
Senior Member
Thanks Camille. I'll try it out
Previous Topic:Papyrus java.lang.ClassNotFoundException
Next Topic:Definition Profile Papyrus
Goto Forum:
  


Current Time: Mon Jul 06 21:41:28 GMT 2020

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

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

Back to the top