Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » [0.9.1] Using Graphiti with external editing domain causes problem at clean up
[0.9.1] Using Graphiti with external editing domain causes problem at clean up [message #1006267] Wed, 30 January 2013 10:57 Go to previous message
Cedric Moonen is currently offline Cedric Moonen
Messages: 214
Registered: August 2009
Senior Member
Hello,

I'm using a graphiti editor as a page inside a multi-page editor. In order to have the undo command stack working properly with the rest of the editor, I provide my own editing domain to graphiti (by overriding the DefaultUpdateBehavior). This works fine, but I have the requirement that if a specific element in my own editor (on another page) is removed, then the graphiti page has to be removed as well. Unfortunately, by doing so, graphiti does some clean-up with the TransactionalEditingDomain causing my application to throw exceptions after that (I can't close nor save my editor anymore for instance).

After a bit of investigation I saw that in the dispose method of the DiagramEditor, there are thinkgs like this:
		if (getEditDomain() != null && getEditDomain().getCommandStack() != null) {
			getEditDomain().getCommandStack().removeCommandStackEventListener(gefCommandStackListener);
			getEditDomain().getCommandStack().dispose();
		}


I could override the dispose method but there are things which I can't access, e.g. this piece of code:
		if (getConfigurationProvider() != null) {
			getConfigurationProvider().dispose();
		}

		if (paletteBehaviour != null) {
			paletteBehaviour.dispose();
		}

		markerBehavior.dispose();


Or even call the dispose method of the super class (GraphicalEditorWithFlyoutPalette) :
			try {
				super.dispose();
			} catch (RuntimeException e) {
				exc = e;
			}


How can I properly dispose my editor without breaking the full editing domain in this case ?
 
Read Message
Read Message
Read Message
Read Message
Previous Topic:How to update existing diagrams, if domain model structure has changed?
Next Topic:Add actions/actionsets to the context-menu?
Goto Forum:
  


Current Time: Sun May 19 09:08:47 EDT 2013

Powered by FUDForum. Page generated in 0.05807 seconds