Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Composition Edge Delete
Composition Edge Delete [message #1722803] Tue, 09 February 2016 09:28 Go to next message
Aria Malik Havidiansyah is currently offline Aria Malik HavidiansyahFriend
Messages: 2
Registered: February 2016
Junior Member
Hi,

i'm trying to make my own Diagram and currently encountering this problems :

1.) In my Diagram i have class A, which element consist of elements [0...*] from class B. I've created tools to create elements from class A and B and the relation from A to B is represented in an edge called super. I don't have any problem setting this super relation with Edge Creation and Set. But when i'm trying to unset this relation, it's always ending up removing the element B at the end of the edge. I've tried this unset methods with others relation (reference), and it worked really well. So i'am assuming that it has somthing to do with the type of the relations. Does anyone know how to solve this problem?

2.) If my class A have more than 1 attribute, how can i represent all this attributes in my Nodes if i'm using Diagram Description? And how to use direct edit tools to change all this attributes ?



Best regards,
Re: Composition Edge Delete [message #1723079 is a reply to message #1722803] Thu, 11 February 2016 12:29 Go to previous messageGo to next message
Yann Mortier is currently offline Yann MortierFriend
Messages: 16
Registered: July 2009
Location: Paris FR
Junior Member
Hi

1) Is the super reference a containment reference? If it is the case, when you remove the b element from the super reference then the element is an orphaned (it is not contained in a resource). An element must have a parent (eContainer). You can use the move operation to change the parent of an element.

2) It depends what you want.

If you want something similar to the Ecore Tools 2 diagrams (see EAttribute instances on image1. The diagram displays the name and the type for each attribute) you can have a look to the odesign file into org.eclipse.emf.ecoretools.design. This odesign file has tools to edit attributes and operations.

Another idea is to display all attributes in a list. You can achieve it using a ContainerMapping (for A) with Children Representations set to List. Then create a NodeMapping under this list for each attribute you want to display:



  • Domain Class = ClassA
  • Semantic Candidates Expression = var:self


Then, define a label and a direct edit tool for the attribute.

Note: you can't convert a NodeMapping to ContainerMapping. You have to delete the old node mapping and create a new container mapping.

image1
https://www.eclipse.org/ecoretools/doc/pasted-images/35ed765cb8af3fb4ab1a95cd3803fe94.png


Cheers,
Yann

[Updated on: Thu, 11 February 2016 12:30]

Report message to a moderator

Re: Composition Edge Delete [message #1723179 is a reply to message #1723079] Fri, 12 February 2016 11:26 Go to previous message
Aria Malik Havidiansyah is currently offline Aria Malik HavidiansyahFriend
Messages: 2
Registered: February 2016
Junior Member
Hi,

Thank you for your help. The second problem is solved. I've used your second methods. I don't really understand how to open this org.eclipse.emf.ecoretools.design.

I undestand your first answer, but i don't really know how to address the parents (the parents of class A is the class C which is the class of the Diagram), because i don't know the classes (DEdge, DSemanticDiagram, etc.) and the operations this classes able to do. I'm actually familiar with Java Programming if i understand the classes and the operations. Could you tell me where i can learn these things?


Best regards,

Aria Malik Havidiansyah
Previous Topic:How to delete view programmatically of a given DDiagramElement
Next Topic:Sirius create viewpoint for ReqIF
Goto Forum:
  


Current Time: Wed Apr 14 18:15:35 GMT 2021

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

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

Back to the top