Skip to main content


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 11:11 Go to next message
Fayçal Benaziz is currently offline Fayçal BenazizFriend
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 14:27 Go to previous messageGo to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
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 16:41 Go to previous message
Fayçal Benaziz is currently offline Fayçal BenazizFriend
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: Tue Apr 16 15:04:38 GMT 2024

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

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

Back to the top