Share the same editingDomain in MultiPageEditor [message #1219866] |
Fri, 06 December 2013 06:11  |
Eclipse User |
|
|
|
Hi everyone,
I'm developping a collection of diagrams in a MultiPageEditor. So I would like to know if there is a way to share one editingDomain for all the diagrams opened in my MultiPageEditor.
So I tried to define statically an editingDomain with the extension point "org.eclipse.emf.transaction.editingDomains". When I add a new page in my MultiPageEditor (so I open a diagram already created), there is an editingDomain which is automatically created by the function addPage(IEditorPart, IEditorInput) of the MultiPageEditor. Therefore, I change this editingDomain by mine.
But when I modify my diagram it doesn't save it. And when I close it I have an exception which said that I can't dispose my editingDomain because he was created statically.
Is it the good way to do this, or there is another solution ?
Maybe if I can't share my editingDomain, is it a problem or can I continue with differents editingDomains ?
Best regards,
--
Fayçal
|
|
|
Re: Share the same editingDomain in MultiPageEditor [message #1219965 is a reply to message #1219866] |
Sat, 07 December 2013 09:27   |
Eclipse User |
|
|
|
Hi,
I've also created a MultiPageEditor and had to handle the issue of
reusing the editing domain of the first opened embedded editor.
Essentially, the class responsible for providing the editing domain,
checks if its parent is a MultiPageEditor and already has an editor
inside, and reuses this editor's editing domain. You can have a look
here:
https://github.com/hallvard/ptolemy/tree/master/org.ptolemy.graphiti.generic/src/org/ptolemy/graphiti/generic/editor
It's the ActorDiagramBehavior class that handles this.
Hallvard
On 06.12.13 15:02, Fayçal Benaziz wrote:
> Hi everyone,
>
> I'm developping a collection of diagrams in a MultiPageEditor. So I
> would like to know if there is a way to share one editingDomain for all
> the diagrams opened in my MultiPageEditor.
>
> So I tried to define statically an editingDomain with the extension
> point "org.eclipse.emf.transaction.editingDomains". When I add a new
> page in my MultiPageEditor (so I open a diagram already created), there
> is an editingDomain which is automatically created by the function
> addPage(IEditorPart, IEditorInput) of the MultiPageEditor. Therefore, I
> change this editingDomain by mine.
> But when I modify my diagram it doesn't save it. And when I close it I
> have an exception which said that I can't dispose my editingDomain
> because he was created statically.
>
> Is it the good way to do this, or there is another solution ?
> Maybe if I can't share my editingDomain, is it a problem or can I
> continue with differents editingDomains ?
>
> Best regards,
>
> --
> Fayçal
|
|
|
Re: Share the same editingDomain in MultiPageEditor [message #1220101 is a reply to message #1219965] |
Mon, 09 December 2013 11:41  |
Eclipse User |
|
|
|
Hello,
Thank you for your quick and clear reply. I tried your snapshot and it works, the editingDomain is shared for all my opened diagrams. The only problem is that when I change the active editor, the property menu doesn't work anymore (only the first opened diagram works). I will search by myself the solution but thank you again.
regards,
Fayçal
|
|
|
Powered by
FUDForum. Page generated in 0.03269 seconds