Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Shared EditingDomain and OpenDiagram bahaviour
Shared EditingDomain and OpenDiagram bahaviour [message #496646] Tue, 10 November 2009 18:55 Go to next message
TL is currently offline TLFriend
Messages: 22
Registered: July 2009
Junior Member
Hi,

I am wondering about the shared EditingDomain feature in my special
situation and the effects of it.

I have one metamodel (i.e., domain model) with 3 different diagram types
(3 sets of graphical, tool, mapping and generator models), which should
all enable the manipulation of one model but form different perspectives.

At my top diagram type I open the other two diagram types via the
openDiagram behavior. Therefore in my understanding by default these sub
diagrams are manipulating the same model. What I am wondering about is
if these editors have a shared EditingDomain by default? I have not set
the properties of all the different diagram types according to the
tutorial provided at:
http://wiki.eclipse.org/GMF_Tips#Sharing_single_EditingDomai n_instance_across_several_diagrams

What is the behavior I have to expect since I have not explicitly shared
the EditingDomain as showed in the tutorial?

Btw: I decided to use same file for diagram and model to not confuse the
end users.

Thank you for any comments.
Re: Shared EditingDomain and OpenDiagram bahaviour [message #496792 is a reply to message #496646] Wed, 11 November 2009 11:29 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
comments inlined

T L wrote:
> What is the behavior I have to expect since I have not explicitly shared
> the EditingDomain as showed in the tutorial?
>

Not sharing an editing domain, means you don't share the command stack
and also the place holder for your resourceset. So you would will have:

- Multiple editing domains
- each holding a resourceset with a memory representation of your
semantic and diagram models. See [yourmodel]DocumentProvider which
creates/loads in a new resource in method setDocumentContent(...)

- each holding a commandstack (undo/redo would be editor specific), this
I think is a good approach.


I have come to the conclusion, that creating an app with multiple
diagram editors, requires a much more rigorous approach. Basically my
approach would be to use the generated GEF items from multiple diagrams
and put these in one plugin. Next, I will extract UI classes like
menu's, preferences, CNF and the Editor class and make these generic
enough to be able to handle multiple editors.

In practise it would work like this.

..gmfgen1
..gmfgen2
..gmfgen3

resulting in the GEF packages for these 3 diagram editors:

[yourpackage1].commands
[yourpackage1].helpers
[yourpackage1].parts
[yourpackage1].policies
[yourpackage1].providers

[yourpackage2].commands
[yourpackage2].helpers
[yourpackage2].parts
[yourpackage2].policies
[yourpackage2].providers

etc...

(rest of the generated code and manifest is thrown away or kept for
sentimental reasons :-)

These are copied to a single new plugin.
In this new plugin I have adapted the UI framework classes to work with
multiple editors. Note, I am in the process of working out the details
of this ( I am not even sure it will be possible), but will report back
with a article when done.


> Btw: I decided to use same file for diagram and model to not confuse the
> end users.
Good choice!

>
> Thank you for any comments.
Previous Topic:To remove the square that makes a detour to the figure
Next Topic:Graphics initialization
Goto Forum:
  


Current Time: Fri Mar 29 06:13:49 GMT 2024

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

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

Back to the top