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 08:50 Go to next message
Ken Wenzel is currently offline Ken Wenzel
Messages: 39
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 07:14 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1571
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: Tue Jul 22 21:48:44 EDT 2014

Powered by FUDForum. Page generated in 0.01883 seconds