Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Share the same editingDomain in MultiPageEditor
Share the same editingDomain in MultiPageEditor [message #1219866] Fri, 06 December 2013 06:11 Go to next message
Fayçal Benaziz is currently offline Fayçal Benaziz
Messages: 7
Registered: December 2013
Junior Member
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 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard Traetteberg
Messages: 594
Registered: July 2009
Location: Trondheim, Norway
Senior Member
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 Go to previous message
Fayçal Benaziz is currently offline Fayçal Benaziz
Messages: 7
Registered: December 2013
Junior Member
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
Previous Topic:graphiti property view during refresh,want to write model by emf recording commad
Next Topic:MultiText bounds
Goto Forum:
  


Current Time: Thu Jul 24 00:24:54 EDT 2014

Powered by FUDForum. Page generated in 0.01629 seconds