Skip to main content



      Home
Home » Eclipse Projects » Sirius » Don't understand how drag'n drop tool works
Don't understand how drag'n drop tool works [message #1729115] Mon, 11 April 2016 06:39 Go to next message
Eclipse UserFriend
Hi,

I created a representation showing two kinds of containers. The containers own subnodes and I want to drag a subnode from one container to another.

I created a small metamodel with the following concepts:

Class owning Attributes
SiblingClass owning SiblingAttributes.

I want to drag a SiblingAttribute onto a Class resulting in the creation of an Attribute in that Class that has the same name.

I don't succeed in getting this to work. The environment doesn't allow to to drop the attribute on the class.

Attached you'll find a zip with:
- the project containing the metamodel
- the project containing the vsp
- the project containing an example model (as dynamic instance) with representation

What am I doing wrong here (or did I encounter a bug in Sirius)?

Greetings,
Wilbert
Re: Don't understand how drag'n drop tool works [message #1729160 is a reply to message #1729115] Mon, 11 April 2016 11:37 Go to previous messageGo to next message
Eclipse UserFriend
Hi Wilbert,

I'm not that expert but I'm using drag n drop to do the same as what you want to do ! It is working fine for me, don't think it is a bug.

Maybe the reason is that in the SiblingClass container you have defined attribute nodes with the domain class of SiblingAttribute and in the Classs container you have defined Attribute as the domain class. Therefore, since the types are not matching then it does not allow you. Since they Attribute and SiblingAttribute are different types then you can't do it. You can create a parent class named "GeneralAttribute" and make the Attribute and SiblingAttribute inherit from the GeneralAttribute. This way you can exchange your attributes between the containers.

hope it help,
Bests,
Parsa
Re: Don't understand how drag'n drop tool works [message #1729332 is a reply to message #1729160] Wed, 13 April 2016 03:32 Go to previous messageGo to next message
Eclipse UserFriend
Hi Parsa,

I understand your remark and it is right. However, I don't want to change the language (yet). I don't see why the child I drop on the container needs to be an allowed child of the container. I know that the Class container won't accept a SiblingAttribute but dropping it should be usable to trigger execution of some model operations that do change the Class (by adding a newly created SiblingAttribute).

Greetings,
Wilbert
Re: Don't understand how drag'n drop tool works [message #1730656 is a reply to message #1729332] Wed, 27 April 2016 08:56 Go to previous message
Eclipse UserFriend
Hi Wilbert,

The drag container tool behavior is led by mapping definition. You have
a forbiden mark when you want droped sibling attribute mapping SA2 in
Class C1 because in mapping definition a class could only contain an
attribute mmapping and not a sibling attribute mapping.
To make this possible, you should just say to sirius that a sibling
attribute mapping could be a child of Class mapping. For that you have
to use Import tab In ClassNode mapping and use Reused Node Mappings:
SiblingAttributeNode.
With your example, you can have this result[1]

[1] See attached screenshot (I have droped SA2 from S1 to C1)

Regards,


--
Julien - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Export representation as image problem
Next Topic:Double click
Goto Forum:
  


Current Time: Sat Mar 15 17:49:58 EDT 2025

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

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

Back to the top