Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Share EditingDomain between multiple diagram editors
Share EditingDomain between multiple diagram editors [message #554804] Tue, 24 August 2010 12:50 Go to next message
Ken Wenzel is currently offline Ken WenzelFriend
Messages: 51
Registered: July 2009
Member
Hello,

I want to share the same EditingDomain instance between multiple diagram editors to implement a drill down feature while storing all diagrams in one file.

The following code in DiagramEditorBehavior.dispose() makes this impossible since it removes all resources from the ResourceSet:

// Clear the editing domain of all resources with potentially unsaved changes 
try {
	editingDomain.runExclusive(new Runnable() {
		@Override
		public void run() {
			editingDomain.getResourceSet().getResources().retainAll(Collections.EMPTY_LIST);
		}
	});
} catch (final InterruptedException e) {
	T.racer().error(e.getMessage(), e);
}


Is it be possible to only clear the ResourceSet if DiagramEditorInput.disposeEditingDomain?

Thank you.

Best regards,
Ken
Re: Share EditingDomain between multiple diagram editors [message #555063 is a reply to message #554804] Wed, 25 August 2010 11:14 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
You're right, this coding currently prevents sharing one editing domain
accross editors. I moved this passage to the disposal of the editing domain
and checked-in that fix to CVS. This should solve that issue.

-Michael


"Ken Wenzel" <kenwenzel@gmx.net> wrote in message
news:i50f79$itp$1@build.eclipse.org...
> Hello,
>
> I want to share the same EditingDomain instance between multiple diagram
> editors to implement a drill down feature while storing all diagrams in
> one file.
>
> The following code in DiagramEditorBehavior.dispose() makes this
> impossible since it removes all resources from the ResourceSet:
>
>
> // Clear the editing domain of all resources with potentially unsaved
> changes try {
> editingDomain.runExclusive(new Runnable() {
> @Override
> public void run() {
> editingDomain.getResourceSet().getResources().retainAll(Coll ections.EMPTY_LIST);
> }
> });
> } catch (final InterruptedException e) {
> T.racer().error(e.getMessage(), e);
> }
>
>
> Is it be possible to only clear the ResourceSet if
> DiagramEditorInput.disposeEditingDomain?
>
> Thank you.
>
> Best regards,
> Ken
Previous Topic:Auto layout support in Graphiti
Next Topic:Zipped version of update site available
Goto Forum:
  


Current Time: Thu Apr 25 00:50:40 GMT 2024

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

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

Back to the top