|
Re: Shared EditingDomain and OpenDiagram bahaviour [message #496792 is a reply to message #496646] |
Wed, 11 November 2009 11:29 |
Christophe Bouhier 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.
|
|
|
Powered by
FUDForum. Page generated in 0.03511 seconds