diff options
author | Partrick Paulin | 2013-04-12 14:43:36 +0000 |
---|---|---|
committer | Partrick Paulin | 2013-04-12 14:43:36 +0000 |
commit | e7a69132b98828b2d44e3e55dcb49c71f6e04a38 (patch) | |
tree | 03a4c4caa0b9d7399adb54c6b67367fdb33b0008 | |
parent | 084aa069cc22448e93eb888a236c4360a3e8a801 (diff) | |
download | org.eclipse.graphiti-e7a69132b98828b2d44e3e55dcb49c71f6e04a38.tar.gz org.eclipse.graphiti-e7a69132b98828b2d44e3e55dcb49c71f6e04a38.tar.xz org.eclipse.graphiti-e7a69132b98828b2d44e3e55dcb49c71f6e04a38.zip |
Bug 405314 - Moved setParent and init method calls into init of
DiagramEditor.
Developers who provide subclasses of DiagramBehavior can just
instantiate it in the createDiagramBehavior method without worrying
about configuration and initialization.
Change-Id: If5db18396e694860de829da437d847b4d794239e
-rw-r--r-- | plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditor.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditor.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditor.java index 6ce4e07d..05164c0d 100644 --- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditor.java +++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/editor/DiagramEditor.java @@ -34,6 +34,7 @@ * pjpaulin - Bug 352120 - Main implementation of DiagramEditor - API BREAKAGE HERE * pjpaulin - Bug 352120 - Renamed from DiagramEditorImpl so that classes extending DiagramEditor do not break * mwenz - Bug 394315 - Enable injecting behavior objects in DiagramEditor + * pjpaulin - Bug 405314 - Should be able to override DefaultBehavior implementation without configuration * * </copyright> * @@ -194,6 +195,8 @@ public class DiagramEditor extends GraphicalEditorWithFlyoutPalette implements I */ public void init(IEditorSite site, IEditorInput input) throws PartInitException { diagramBehavior = createDiagramBehavior(); + diagramBehavior.setParentPart(this); + diagramBehavior.initDefaultBehaviors(); // Eclipse may call us with other inputs when a file is to be // opened. Try to convert this to a valid diagram input. @@ -238,11 +241,7 @@ public class DiagramEditor extends GraphicalEditorWithFlyoutPalette implements I * @since 0.10 */ protected DiagramBehavior createDiagramBehavior() { - DiagramBehavior diagramBehavior = new DiagramBehavior(this); - diagramBehavior.setParentPart(this); - diagramBehavior.initDefaultBehaviors(); - - return diagramBehavior; + return new DiagramBehavior(this); } /** |