This service is archived, please use www.eclipse.org/forums


Home » Capella » Capella Studio » Get Logical Component name from Logical Component Port
Get Logical Component name from Logical Component Port [message #3486] Sat, 24 August 2019 16:59 Go to next message
Toni D is currently offline  Toni D
Messages: 2
Registered: August 2019
Junior Member
Hello,

When I look at a Logical Component properties I can find all the Contained Component Ports.
When I look at a Component Exchange properties I can find the Source Port but not the associated Component...

Is there any way to get the Logical Component name associated to a Component Port?
I'm developping a java plugin and I would like to find the component name by this way: Component Exchange -> Source Port -> associated Component name

Thanks a lot for your help!
Re: Get Logical Component name from Logical Component Port [message #3487 is a reply to message #3486] Sun, 25 August 2019 04:11 Go to previous messageGo to next message
Toni D is currently offline  Toni D
Messages: 2
Registered: August 2019
Junior Member
Hi,

Finally I've found myself a solution. Maybe not the best but it works (if someone has a better one, let me know)

I get the Logical Component name by using the eContainer() method of the Logical Component Exchange source Port (getSourcePort() method). The eContainer returns the logical component as an eObject which I cast into a LogicalComponent to use the getName method.
Re: Get Logical Component name from Logical Component Port [message #3517 is a reply to message #3487] Mon, 09 September 2019 07:15 Go to previous message
jmorane is currently offline  jmorane
Messages: 63
Registered: May 2019
Member
Hello Toni,

I faced the same issue than you, and have an other problem.

Was it possible for you to directly use the eContainer() method on the Logical Port ?

When I tried that piece of code :

////////////////
PhysicalPort sourcePP = Link.getSourcePhysicalPort();
PhysicalComponent targetComp = (PhysicalComponent) sourcePP.eContainer();
////////////////////////

it raises an error, " The method eContainer() is undefined for the type PhysicalPort "

What was your piece of code for obtaining the Logical Component port ?

[Updated on: Wed, 11 September 2019 07:06]

Report message to a moderator

Previous Topic: How to access PVMT property of selected object ?
Next Topic: Modifing an model element
Goto Forum:
  


Current Time: Sat Mar 28 04:37:24 EST 2020

Total time taken to generate the page: 0.01589 seconds