Bug 389426 - Add factory method for creating EMF workspace synchronizer
delegate
Change-Id: I6b470521851832d670cece8e18c4b411536b7144
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultUpdateBehavior.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultUpdateBehavior.java
index 61afe95..bf16c09 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultUpdateBehavior.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DefaultUpdateBehavior.java
@@ -13,6 +13,7 @@
* mwenz - Bug 347152 - Do not log diagnostics errors as errors in the Eclipse error log
* mwenz - Bug 359928 - DiagramEditorBehavior does not initialize adapterActive field
* Bug 336488 - DiagramEditor API - Rename from DiagramEditorBehavior to DefaultUpdateBehavior
+ * mwenz - Bug 389426 - Add factory method for creating EMF workspace synchronizer delegate
*
* </copyright>
*
@@ -393,14 +394,30 @@
// Install synchronizer for editor-external changes to the files
// underlying the resources of the ED
- workspaceSynchronizer = new WorkspaceSynchronizer(getEditingDomain(),
- new DomainModelWorkspaceSynchronizerDelegate(diagramEditor));
+ workspaceSynchronizer = new WorkspaceSynchronizer(getEditingDomain(), createWorkspaceSynchronizerDelegate());
// Problem analysis
diagramEditor.editingDomainInitialized();
}
/**
+ * Can be overridden to return a client specific implementation of a
+ * {@link WorkspaceSynchronizer} {@link Delegate} object. Graphiti uses the
+ * returned instance to manage and react on changes done to the resources
+ * tied to the diagram outside of the diagram editor's
+ * TransactionalEditingDomain.
+ *
+ * @return The delegate to use. The default implementation return's
+ * Graphiti's own implementation of such a delegate that should be
+ * sufficient for most client editors.
+ *
+ * @since 0.10
+ */
+ protected WorkspaceSynchronizer.Delegate createWorkspaceSynchronizerDelegate() {
+ return new DomainModelWorkspaceSynchronizerDelegate(diagramEditor);
+ }
+
+ /**
* Disposes this {@link DefaultUpdateBehavior} and free all resources it
* holds. In case you only want to omit or influence the disposal of the
* {@link TransactionalEditingDomain}, you can also override