Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Container Drop
Container Drop [message #1776159] Mon, 13 November 2017 10:14 Go to next message
Yash Khatri is currently offline Yash KhatriFriend
Messages: 31
Registered: October 2017
In the Section Tools, I have created a tool to create Container. Now, I have created another tool "Container Drop" and the operation in begin is "Create View". (see image).

So the scenario is: I have created this container in one diagram A and dragged-dropped from model to other instances of diagram A.

My question is:
1. When deleting this container from one diagram I want to first check if this container is represented in other diagrams or not. If so, confirm before deleting. How will I get this information in the "Delete Element" tool that the element is represented in another diagrams as well.

2. Since, the dragged and dropped container is having only view (create view) in other diagram and when I do the container.eContainer().eAllContents() it does not show the container that is dropped here. How can I see the containers that are created else where but also represented in the current diagram.

Any pointers are appreciated.

(I hope I am able to explain the problem :) )


Re: Container Drop [message #1776170 is a reply to message #1776159] Mon, 13 November 2017 11:23 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 508
Registered: May 2011
Senior Member

1. You can find all diagram element referencing a semantic element using the session cross referencer like this:
ECrossReferenceAdapter xref = session.getSemanticCrossReferencer();
for (EStructuralFeature.Setting setting : xref.getInverseReferences(semanticElement)) {
If you find DiagramElements that are not in the current diagram, then you can trigger the confirmation dialog before deleting.

2. I do not understand your question. You can't have only view in other diagram, graphical elements are based on semantic elements. I assume that your are working on unsychronized diagram if you need drag and drop tools creating views. Then you start from a blank diagram and use your tool to only display the semantic elements you want on your diagram. Right? Then if you want to access other representation of a semantic element you should use the semantic cross referencer as in answer 1.


Steve Monnier - Obeo
Need training or professional services for Sirius?
Previous Topic:SiriusCon 2017
Next Topic:Sirius Tutorials
Goto Forum:

Current Time: Thu Mar 04 17:10:33 GMT 2021

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

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

Back to the top