Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to Add a Shortcut to the Domain Model
How to Add a Shortcut to the Domain Model [message #1731565] Fri, 06 May 2016 19:41 Go to next message
Taher Mohamed Yhd is currently offline Taher Mohamed YhdFriend
Messages: 15
Registered: May 2016
Junior Member
I am using shortcuts under GMF i can drag and drop the elments to my GMF editor, but my problem is how can i represente the shortcuts under the domain model , not only under the diagram model ??
Can somebody helps me

[Updated on: Fri, 06 May 2016 19:47]

Report message to a moderator

Re: How to Add a Shortcut to the Domain Model [message #1731695 is a reply to message #1731565] Mon, 09 May 2016 10:55 Go to previous messageGo to next message
Christian Smietana is currently offline Christian SmietanaFriend
Messages: 14
Registered: February 2011
Junior Member
It's not possible to add a shortcut to the domain model. However, there might be another solution to your problem, maybe using a DragDropEditPolicy. Please describe as detailed as possible the purpose of your application and what you want to achieve.

[Updated on: Mon, 09 May 2016 10:56]

Report message to a moderator

Re: How to Add a Shortcut to the Domain Model [message #1731731 is a reply to message #1731695] Mon, 09 May 2016 15:43 Go to previous messageGo to next message
Taher Mohamed Yhd is currently offline Taher Mohamed YhdFriend
Messages: 15
Registered: May 2016
Junior Member
Thank you for your answer,
My problem is : I want to show to diagrams in one diagram : so i drag and drop those two diagrams in one diagram, but the added diagrams appear only in the diagram model, i want them to appear also in the domain model as part of its hiearchy.

I hope that i was clear
Re: How to Add a Shortcut to the Domain Model [message #1731837 is a reply to message #1731731] Tue, 10 May 2016 12:32 Go to previous messageGo to next message
Taher Mohamed Yhd is currently offline Taher Mohamed YhdFriend
Messages: 15
Registered: May 2016
Junior Member
To be more clear : I want to put the generated shorcuts diagrams as part of my domain model and not only apear as part of diagram model
Re: How to Add a Shortcut to the Domain Model [message #1731875 is a reply to message #1731837] Tue, 10 May 2016 15:26 Go to previous messageGo to next message
Christian Smietana is currently offline Christian SmietanaFriend
Messages: 14
Registered: February 2011
Junior Member
As I said, shortcuts in the domain model are not possible. But you can do the following, if the two diagrams use the same model type: edit the DiagramDragDropEditPolicy use by your XXDiagramEditor. This policy implements what happens when you drag and drop something onto the diagram. Edit this policy so that when an object is dropped, it creates a copy of the object in the domain model.

[Updated on: Tue, 10 May 2016 15:28]

Report message to a moderator

Re: How to Add a Shortcut to the Domain Model [message #1731979 is a reply to message #1731875] Wed, 11 May 2016 12:10 Go to previous messageGo to next message
Taher Mohamed Yhd is currently offline Taher Mohamed YhdFriend
Messages: 15
Registered: May 2016
Junior Member
Thank you for your reply
Yes you are undertanting my problem, yes my diagrams use the same model type: and i want exactly what you said copy of the objects in my domain model, How can i edit the DiagramDragDropEditPolicy by my XXDiagramEditor??
Re: How to Add a Shortcut to the Domain Model [message #1732017 is a reply to message #1731979] Wed, 11 May 2016 19:15 Go to previous messageGo to next message
Taher Mohamed Yhd is currently offline Taher Mohamed YhdFriend
Messages: 15
Registered: May 2016
Junior Member
Can you give me a section of code implementing the issue of when i drag and drop something into the diagram a copy of those objects is created in the domain model ?

[Updated on: Wed, 11 May 2016 19:40]

Report message to a moderator

Re: How to Add a Shortcut to the Domain Model [message #1732179 is a reply to message #1732017] Fri, 13 May 2016 10:00 Go to previous messageGo to next message
Taher Mohamed Yhd is currently offline Taher Mohamed YhdFriend
Messages: 15
Registered: May 2016
Junior Member
Hello Christian,
I realy need your help to solve my ploblem, can you give me a snipet of code solving this problem, i'am blocked and cannot make another step witout solving it Sad

[Updated on: Fri, 13 May 2016 10:06]

Report message to a moderator

Re: How to Add a Shortcut to the Domain Model [message #1732274 is a reply to message #1732179] Sat, 14 May 2016 12:11 Go to previous messageGo to next message
Christian Smietana is currently offline Christian SmietanaFriend
Messages: 14
Registered: February 2011
Junior Member
You need to learn how emf models are manipulated. Creating a domain object of class MyDomainObject works like this (XXX is the name of your model):

XXXFactory.eInstance().createMyDomainObject()

After this you have to set the object's properties, this depends on your domain model. Check out your generated emf classes. Then insert this code into the DragDropEditPolicy which is located in your main editor class (XXXDiagramEditor.java, again XXX is the name of your model).
Re: How to Add a Shortcut to the Domain Model [message #1732281 is a reply to message #1732274] Sat, 14 May 2016 14:22 Go to previous messageGo to next message
Taher Mohamed Yhd is currently offline Taher Mohamed YhdFriend
Messages: 15
Registered: May 2016
Junior Member
Thhank you so much for your reply

**) MyDOmainObject class didn't exist would i create it ?
**) what i will put in this method: XXXFactory.eInstance().createMyDomainObject() ?
**) DragDropEditPolicy isn't located in the XXXDiagramEditor, it is called in the class XXEditPart : here XX is my root!!

[Updated on: Sun, 15 May 2016 12:08]

Report message to a moderator

Re: How to Add a Shortcut to the Domain Model [message #1734127 is a reply to message #1732281] Sat, 04 June 2016 12:21 Go to previous messageGo to next message
Taher Mohamed Yhd is currently offline Taher Mohamed YhdFriend
Messages: 15
Registered: May 2016
Junior Member
I still having this problem i can't dind the adequate solution, Could you give me a snipet of code implementig that: Representig the shorcuts as part of domain model !! Sad Sad
Re: How to Add a Shortcut to the Domain Model [message #1739668 is a reply to message #1734127] Wed, 03 August 2016 16:20 Go to previous message
Taher Mohamed Yhd is currently offline Taher Mohamed YhdFriend
Messages: 15
Registered: May 2016
Junior Member
Hello,
Someone can help me please, I am really blocked here, i need a snipet of code to solve my problem, witch is how can i represente the shortcuts as a part of my domain model !!!
Previous Topic:DropDown Menu
Next Topic:How can i represent the GMF shortcuts as part of the domain model?
Goto Forum:
  


Current Time: Tue Aug 22 22:39:59 GMT 2017

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

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