diff options
| author | Mickael LANOE | 2015-05-21 09:14:36 +0000 |
|---|---|---|
| committer | Mickael LANOE | 2015-05-27 15:40:53 +0000 |
| commit | 4f7a1debafc1470e8a7128472be0c28bb5bd316b (patch) | |
| tree | a4af1d291acac252a2979d33ebce460f13b705e6 | |
| parent | d4c2e860ddfe828af79d66b5917a60c7e9dcd840 (diff) | |
| download | org.eclipse.sirius-4f7a1debafc1470e8a7128472be0c28bb5bd316b.tar.gz org.eclipse.sirius-4f7a1debafc1470e8a7128472be0c28bb5bd316b.tar.xz org.eclipse.sirius-4f7a1debafc1470e8a7128472be0c28bb5bd316b.zip | |
[467813] Remove the member "diagramOutline" in DDiagramEditorImpl
The member variable "diagramOutline" was referencing the outline and was
not cleared when the outline is closed.
The outline is now initialized each time getAdapter() is called with the
type parameter to IContentOutlinePage.class as it is done in
org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor.getAdapter(Class)
Bug: 467813
Change-Id: Ie48626196787c3ffd3df4ae7115ea380ca9c3f33
Signed-off-by: Mickael LANOE <mickael.lanoe@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java index 8d4ba0c8a4..09321a352a 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -314,8 +314,6 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** the emf command factory provider */ private IDiagramCommandFactoryProvider emfCommandFactoryProvider; - private DiagramOutlinePage diagramOutline; - private boolean isClosing; private IPermissionAuthority authority; @@ -615,7 +613,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE keyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0), getActionRegistry().getAction(ActionFactory.DELETE.getId())); keyHandler.put(/* CTRL + D */ - KeyStroke.getPressed((char) 0x4, 100, SWT.CTRL), getActionRegistry().getAction(ActionIds.ACTION_DELETE_FROM_MODEL)); + KeyStroke.getPressed((char) 0x4, 100, SWT.CTRL), getActionRegistry().getAction(ActionIds.ACTION_DELETE_FROM_MODEL)); } return keyHandler; } @@ -782,7 +780,6 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE } sGViewer = null; } - disposeOutline(); // Dispose the session editor input to keep the minimum information to // be restore from the INavigationHistory and EditorHistory. @@ -815,12 +812,6 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE } } - private void disposeOutline() { - if (diagramOutline != null) { - this.diagramOutline = null; - } - } - private void disposePostCommitListener() { if (tabbarPostCommitListener != null) { tabbarPostCommitListener.dispose(); @@ -855,7 +846,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE this.getGraphicalViewer().setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL), MouseWheelZoomHandler.SINGLETON); } - private void initOutline() { + private DiagramOutlinePage initOutline() { /** the outline popup menu items and associated actions */ IObjectActionDelegateWrapper[] outlinePopupMenuActions = new IObjectActionDelegateWrapper[] { new IObjectActionDelegateWrapper(new HideDDiagramElementAction(HideDDiagramElement.HIDE_ELEMENT_LABEL), HideDDiagramElement.HIDE_ELEMENT_LABEL) { @@ -945,14 +936,15 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE return result; } }, }; - + DiagramOutlinePage outline; if (isOldUIEnabled()) { - diagramOutline = new DiagramOutlineWithBookPages(this.getDiagramEditPart().getModel(), getGraphicalViewer(), outlinePopupMenuActions); + outline = new DiagramOutlineWithBookPages(this.getDiagramEditPart().getModel(), getGraphicalViewer(), outlinePopupMenuActions); } else { - diagramOutline = new DiagramOutlinePage(this.getDiagramEditPart().getModel(), new OutlineLabelProvider(), new OutlineContentProvider(), new OutlineComparator(), getGraphicalViewer(), + outline = new DiagramOutlinePage(this.getDiagramEditPart().getModel(), new OutlineLabelProvider(), new OutlineContentProvider(), new OutlineComparator(), getGraphicalViewer(), outlinePopupMenuActions); } - + outline.setDiagramWorkbenchPart(this); + return outline; } /** @@ -1323,11 +1315,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE if (type == IDiagramCommandFactoryProvider.class) { adapter = this.emfCommandFactoryProvider; } else if (type == IContentOutlinePage.class) { - if (diagramOutline == null) { - initOutline(); - } - diagramOutline.setDiagramWorkbenchPart(this); - adapter = diagramOutline; + adapter = initOutline(); } else if (type == EditingDomain.class || type == TransactionalEditingDomain.class) { adapter = this.getEditingDomain(); } else if (type == IDiagramWorkbenchPart.class) { |
