Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Multiple Plugins, same Domain Model, DND
Multiple Plugins, same Domain Model, DND [message #549875] Wed, 28 July 2010 10:07 Go to next message
masija . is currently offline masija .Friend
Messages: 59
Registered: July 2010
Member
Hi @ all,

I have to develope a GMF plugin, which enables me to create different diagram types of the same domain model.

In addition it must be possible, to add some elements from diagram A to Diagram B with drag and drop.
(And display detailed properties for each element in the diagram)
For example Diagram A contains elements a, b and c
Diagram B contains elements d, e and the element a from Diagram A.

I figured out how to enable drag and drop support, to drag the elements from Diagram A to B.
In the properties view I also have some information about references to other elements.

But if I now change the original element a in Diagram A, for example add or delete a connection to a nother element, the two diagrams come out of sync.
Now the element a in Diagram B disappears out of the canvas, just leaving a connection pointing to nothing.

Does anyone have a hint for me how to solve this problem?

Best Regards
masija
Re: Multiple Plugins, same Domain Model, DND [message #550057 is a reply to message #549875] Thu, 29 July 2010 00:57 Go to previous messageGo to next message
Pantelis Petridis is currently offline Pantelis PetridisFriend
Messages: 10
Registered: February 2010
Junior Member
Hello Masija,

i think you need a sharedEditingDomain.

editingDomain holds information on the diagram and its underlying model.
I guess your problem is that whenever a new editor is opened, GMF
creates a new editingDomain. Therefore multiple instances of your model
exist in the memory, but they are not interconnected.

Maybe GMFTools can be of a help to you:
http://code.google.com/p/gmftools/

Make sure you also read this:
http://code.google.com/p/gmftools/wiki/SharedEditingDomain

On 28/7/2010 1:07 μμ, Masija wrote:
> Hi @ all,
>
> I have to develope a GMF plugin, which enables me to create different
> diagram types of the same domain model.
>
> In addition it must be possible, to add some elements from diagram A to
> Diagram B with drag and drop.
> (And display detailed properties for each element in the diagram)
> For example Diagram A contains elements a, b and c
> Diagram B contains elements d, e and the element a from Diagram A.
>
> I figured out how to enable drag and drop support, to drag the elements
> from Diagram A to B.
> In the properties view I also have some information about references to
> other elements.
>
> But if I now change the original element a in Diagram A, for example add
> or delete a connection to a nother element, the two diagrams come out of
> sync.
> Now the element a in Diagram B disappears out of the canvas, just
> leaving a connection pointing to nothing.
>
> Does anyone have a hint for me how to solve this problem?
>
> Best Regards
> masija
>
Re: Multiple Plugins, same Domain Model, DND [message #550706 is a reply to message #549875] Wed, 04 August 2010 07:58 Go to previous messageGo to next message
masija . is currently offline masija .Friend
Messages: 59
Registered: July 2010
Member
Ok, thanks for your response.
Unfortunately i don't get the gmftools working correct...

Does anybody know, if the sollution in the wiki http:// wiki.eclipse.org/GMF_Tips#Sharing_single_EditingDomain_insta nce_across_several_diagrams is still correct?

Masija
Re: Multiple Plugins, same Domain Model, DND [message #550756 is a reply to message #549875] Wed, 04 August 2010 09:25 Go to previous messageGo to next message
masija . is currently offline masija .Friend
Messages: 59
Registered: July 2010
Member
Ok i have another problem:

Drag and drop is only possible between diagrams of the same type. Here I have the problems with the save/update/ change connections.
Also if I drag a node from the explorer to the canvas, and immediately add new node, the shortcut-node will disappear.

Infos:
I used the contains shortcuts to, and shortcuts provided for function of gmf.
Just added the extensions and model ids
See this tutorial: http://www.jevon.org/wiki/GMF_Drag_Drop


Re: Multiple Plugins, same Domain Model, DND [message #553791 is a reply to message #550756] Wed, 18 August 2010 21:32 Go to previous messageGo to next message
Fernando Herrera is currently offline Fernando HerreraFriend
Messages: 49
Registered: January 2010
Member
Hi Masija, just in case, have you solved this issue?,,, because I have the same problem and I haven't gotten fix it. I can't share the same editing domain across multiple diagrams. Thanks in advance, any help will be util for me.

Fernando
Re: Multiple Plugins, same Domain Model, DND [message #553886 is a reply to message #549875] Thu, 19 August 2010 10:27 Go to previous messageGo to next message
masija . is currently offline masija .Friend
Messages: 59
Registered: July 2010
Member
Hi Fernando,

gmf-tools provides indeed a good sollution for this problem.
http://code.google.com/p/gmftools/wiki/SharedEditingDomain

You can follow this wiki step by step and change your models by hand, or you can use the gmf-tools functionality... (which didnt work correctly for me, because i didnt want to use the gallileo release)

After this step, you have two (or more) plugins (based on the same .ecore) sharing the same editing domain.

The next problem was, that now every change in the domain model will be reflected in every open diagram...
I don't know if you want to use this feature of gmf (see CanonicalDiagramEditingPolicy).

For my use case, the canonical behavior didn't fit, becaus i just wanted to display a part of the domain model.
Here gmftools also provides a good solution:
SemiCanonicalDiagramEditPolicy - only Diagram Elements are updated, model elements which have no representation are ignored.
If you are interested in this behavior take a look at
http:// code.google.com/p/gmftools/wiki/SemiCanonicalDiagramEditPoli cy which is a step by step "tutorial" on how to implement the semi canonical behavior...
Of you want to use the semi canonical behavior, provided by gmftools, you should also use theire dnd-policy...

best regards, and feel free to ask if you need any help Wink
masija



[Updated on: Thu, 19 August 2010 11:07]

Report message to a moderator

Re: Multiple Plugins, same Domain Model, DND [message #664705 is a reply to message #550756] Mon, 11 April 2011 16:13 Go to previous messageGo to next message
Elle  is currently offline Elle Friend
Messages: 6
Registered: April 2011
Location: Cairo, Egypt
Junior Member

Hey Masija,

Have you fixed the problem where the shortcuts disappear? If you have can you tell me what you did??

Cheers,
Re: Multiple Plugins, same Domain Model, DND [message #669556 is a reply to message #664705] Tue, 10 May 2011 18:01 Go to previous message
masija . is currently offline masija .Friend
Messages: 59
Registered: July 2010
Member
Hi Elle,
i solved the problem with the shortcuts with the gmftools projects and using the semi canonical beahvior...
Pleas read the wiki-entires which i linked above if you are interested in this "workaround". The malus of this solution is, that you will have one large model file, and several smaller "views" of this model file....
But perhaps this is acceptable for you?
Previous Topic:The "+" popup: how to remove it?
Next Topic:Loading Resources through Browse Registered Packages
Goto Forum:
  


Current Time: Mon Nov 24 09:47:30 GMT 2014

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

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