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 ?