summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2013-02-27 07:32:25 (EST)
committerSven Rottstock2013-02-27 07:32:25 (EST)
commitd885d0005a1db31be82cb8edf6ca5bea89ef74c0 (patch)
tree1c66be4b25c552244edc7e5dbdc8be7d5b6aff8d
parent1f2566a30a232fd7c903346916352a47d4a612ba (diff)
downloadorg.eclipse.stardust.ide-d885d0005a1db31be82cb8edf6ca5bea89ef74c0.zip
org.eclipse.stardust.ide-d885d0005a1db31be82cb8edf6ca5bea89ef74c0.tar.gz
org.eclipse.stardust.ide-d885d0005a1db31be82cb8edf6ca5bea89ef74c0.tar.bz2
Jira-ID: CRNT-25959
Memory leak in modeller git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@63307 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/AbstractMultiPageGraphicalEditor.java73
-rw-r--r--modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/AbstractMultiPageGraphicalEditorOutlinePage.java27
-rw-r--r--modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/WorkflowModelEditor.java12
-rw-r--r--modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/WorkflowModelEditorContextMenuProvider.java24
-rw-r--r--modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/diagram/actions/CreateApplicationAction.java6
-rw-r--r--modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/diagram/actions/ForwardDeleteAction.java8
-rw-r--r--modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/tree/ModelTreeEditPart.java37
7 files changed, 139 insertions, 48 deletions
diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/AbstractMultiPageGraphicalEditor.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/AbstractMultiPageGraphicalEditor.java
index 3f6e033..49c2970 100644
--- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/AbstractMultiPageGraphicalEditor.java
+++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/AbstractMultiPageGraphicalEditor.java
@@ -19,20 +19,33 @@ import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.gef.*;
+import org.eclipse.gef.DefaultEditDomain;
+import org.eclipse.gef.EditDomain;
+import org.eclipse.gef.GraphicalViewer;
+import org.eclipse.gef.KeyHandler;
+import org.eclipse.gef.KeyStroke;
+import org.eclipse.gef.RootEditPart;
import org.eclipse.gef.commands.CommandStack;
import org.eclipse.gef.commands.CommandStackListener;
import org.eclipse.gef.editparts.ScalableFreeformRootEditPart;
import org.eclipse.gef.editparts.ScalableRootEditPart;
import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.gef.ui.actions.*;
+import org.eclipse.gef.ui.actions.ActionRegistry;
+import org.eclipse.gef.ui.actions.AlignmentAction;
+import org.eclipse.gef.ui.actions.DirectEditAction;
+import org.eclipse.gef.ui.actions.EditorPartAction;
+import org.eclipse.gef.ui.actions.GEFActionConstants;
+import org.eclipse.gef.ui.actions.RedoAction;
+import org.eclipse.gef.ui.actions.SaveAction;
+import org.eclipse.gef.ui.actions.SelectionAction;
+import org.eclipse.gef.ui.actions.StackAction;
+import org.eclipse.gef.ui.actions.UndoAction;
+import org.eclipse.gef.ui.actions.UpdateAction;
+import org.eclipse.gef.ui.actions.ZoomInAction;
+import org.eclipse.gef.ui.actions.ZoomOutAction;
import org.eclipse.gef.ui.parts.SelectionSynchronizer;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.stardust.common.CollectionUtils;
-import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.*;
-import org.eclipse.stardust.modeling.core.editors.parts.properties.UndoablePropSheetEntry;
-import org.eclipse.stardust.modeling.core.utils.FileEditorInputTracker;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorInput;
@@ -45,6 +58,26 @@ import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.PropertySheetPage;
+import org.eclipse.stardust.common.CollectionUtils;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.AlignmentSnapToGridAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.CleanupModelAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.CopySymbolAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.CreateSubprocessFromSelectionAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.CutAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.DeleteAllAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.DiagramPrintAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.DistributeAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.GroupSymbolsAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.PasteSymbolAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.SetDefaultSizeAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.ShowInDiagramAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.ShowInOutlineAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.ShrinkToFitAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.SnapToGridAction;
+import org.eclipse.stardust.modeling.core.editors.parts.diagram.actions.UngroupSymbolsAction;
+import org.eclipse.stardust.modeling.core.editors.parts.properties.UndoablePropSheetEntry;
+import org.eclipse.stardust.modeling.core.utils.FileEditorInputTracker;
+
public abstract class AbstractMultiPageGraphicalEditor extends MultiPageEditorPart
implements IAdaptable
{
@@ -144,7 +177,7 @@ public abstract class AbstractMultiPageGraphicalEditor extends MultiPageEditorPa
addStackAction(new RedoAction(this));
addEditPartAction(new CleanupModelAction(this));
-
+
addEditPartAction(new ShrinkToFitAction(this));
addEditPartAction(new DeleteAllAction(this));
addEditPartAction(new DirectEditAction((IWorkbenchPart) this));
@@ -175,12 +208,12 @@ public abstract class AbstractMultiPageGraphicalEditor extends MultiPageEditorPa
addEditorAction(new SaveAction(this));
addAction(new DiagramPrintAction(this));
- addEditPartAction(new CutAction(this));
+ addEditPartAction(new CutAction(this));
addEditPartAction(new CopySymbolAction(this));
addEditPartAction(new PasteSymbolAction(this));
addEditPartAction(new CreateSubprocessFromSelectionAction(this));
- addEditPartAction(new ShowInDiagramAction(this));
- addEditPartAction(new ShowInOutlineAction(this));
+ addEditPartAction(new ShowInDiagramAction(this));
+ addEditPartAction(new ShowInOutlineAction(this));
IAction zoomIn = new ZoomInAction(getDelegatingZoomManager());
IAction zoomOut = new ZoomOutAction(getDelegatingZoomManager());
@@ -421,7 +454,13 @@ public abstract class AbstractMultiPageGraphicalEditor extends MultiPageEditorPa
// disposy the ActionRegistry (will unbind all actions)
getActionRegistry().dispose();
-
+ actionRegistry = null;
+ editorInputTracker = null;
+ if (outlinePage != null)
+ {
+ outlinePage.dispose();
+ outlinePage = null;
+ }
// important: always call super implementation of unbind
super.dispose();
}
@@ -440,8 +479,8 @@ public abstract class AbstractMultiPageGraphicalEditor extends MultiPageEditorPa
sharedKeyHandler.put(KeyStroke.getPressed(
'c', 'c', 0), getActionRegistry()
.getAction(DiagramActionConstants.CONNECT));
-
- // copy, cut, paste added
+
+ // copy, cut, paste added
sharedKeyHandler.put(KeyStroke.getPressed('c', SWT.CTRL, 0), getActionRegistry()
.getAction(ActionFactory.COPY.getId()));
sharedKeyHandler.put(KeyStroke.getPressed('x', SWT.CTRL, 0), getActionRegistry()
@@ -469,19 +508,19 @@ public abstract class AbstractMultiPageGraphicalEditor extends MultiPageEditorPa
/*
* class MultiPageCommandStackListener implements CommandStackListener { private List
* commandStacks = new ArrayList(2);
- *
+ *
* public void addCommandStack(CommandStack commandStack) {
* commandStacks.add(commandStack); commandStack.addCommandStackListener(this); }
- *
+ *
* public void commandStackChanged(EventObject event) { if (((CommandStack)
* event.getSource()).isDirty()) { setDirty(true); } else { boolean oneIsDirty = false;
* for (Iterator i = commandStacks.iterator(); i.hasNext();) { CommandStack stack =
* (CommandStack) i.next(); if (stack.isDirty()) { oneIsDirty = true; break; } }
* setDirty(oneIsDirty); } }
- *
+ *
* public void dispose() { for (Iterator i = commandStacks.iterator(); i.hasNext();) {
* ((CommandStack) i.next()).removeCommandStackListener(this); } commandStacks.clear(); }
- *
+ *
* public void markSaveLocations() { for (Iterator i = commandStacks.iterator();
* i.hasNext();) { ((CommandStack) i.next()).markSaveLocation(); } } }
*/
diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/AbstractMultiPageGraphicalEditorOutlinePage.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/AbstractMultiPageGraphicalEditorOutlinePage.java
index 62ffa19..6607bb6 100644
--- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/AbstractMultiPageGraphicalEditorOutlinePage.java
+++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/AbstractMultiPageGraphicalEditorOutlinePage.java
@@ -89,7 +89,7 @@ public abstract class AbstractMultiPageGraphicalEditorOutlinePage
private ActionRegistry actionRegistry;
private ISelectionListener selectionListener;
-
+
private OutlineTreeEditor outlineTreeEditor;
AbstractMultiPageGraphicalEditorOutlinePage(WorkflowModelEditor editor,
@@ -144,10 +144,10 @@ public abstract class AbstractMultiPageGraphicalEditorOutlinePage
bars.setGlobalActionHandler(id, registry.getAction(id));
id = ActionFactory.COPY.getId();
bars.setGlobalActionHandler(id, registry.getAction(id));
- id = ActionFactory.PASTE.getId();
+ id = ActionFactory.PASTE.getId();
+ bars.setGlobalActionHandler(id, registry.getAction(id));
+ id = ActionFactory.CUT.getId();
bars.setGlobalActionHandler(id, registry.getAction(id));
- id = ActionFactory.CUT.getId();
- bars.setGlobalActionHandler(id, registry.getAction(id));
// id = IncrementDecrementAction.INCREMENT;
// bars.setGlobalActionHandler(id, registry.getAction(id));
// id = IncrementDecrementAction.DECREMENT;
@@ -202,8 +202,8 @@ public abstract class AbstractMultiPageGraphicalEditorOutlinePage
public OutlineTreeEditor getOutlineTreeEditor()
{
return outlineTreeEditor;
- }
-
+ }
+
public Control getControl()
{
return pageBook;
@@ -218,8 +218,21 @@ public abstract class AbstractMultiPageGraphicalEditorOutlinePage
getCanvas().removeDisposeListener(disposeListener);
}
+ if (outlineTreeEditor != null)
+ {
+ outlineTreeEditor.dispose();
+ outlineTreeEditor = null;
+ }
+
editor.resetOutlinePage();
+ if (actionRegistry != null)
+ {
+ actionRegistry.dispose();
+ actionRegistry = null;
+ }
+
+
super.dispose();
}
@@ -412,7 +425,7 @@ public abstract class AbstractMultiPageGraphicalEditorOutlinePage
IAction action = null;
// selection.getModel is ConnectionImpl
Object model = selection.getModel();
- if(model instanceof DiagramType)
+ if(model instanceof DiagramType)
{
action = getActionRegistry().getAction(DiagramActionConstants.DIAGRAM_OPEN);
}
diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/WorkflowModelEditor.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/WorkflowModelEditor.java
index e4a3188..d6ac77e 100644
--- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/WorkflowModelEditor.java
+++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/WorkflowModelEditor.java
@@ -83,7 +83,6 @@ import org.eclipse.stardust.model.xpdl.carnot.DiagramType;
import org.eclipse.stardust.model.xpdl.carnot.EndEventSymbol;
import org.eclipse.stardust.model.xpdl.carnot.IGraphicalObject;
import org.eclipse.stardust.model.xpdl.carnot.IIdentifiableModelElement;
-import org.eclipse.stardust.model.xpdl.carnot.IModelElement;
import org.eclipse.stardust.model.xpdl.carnot.IModelElementNodeSymbol;
import org.eclipse.stardust.model.xpdl.carnot.INodeSymbol;
import org.eclipse.stardust.model.xpdl.carnot.ModelType;
@@ -183,12 +182,12 @@ public class WorkflowModelEditor extends AbstractMultiPageGraphicalEditor
private ModelServer modelServer;
- private final ValidationIssueManager validationIssueManager = new ValidationIssueManager();
+ private ValidationIssueManager validationIssueManager = new ValidationIssueManager();
- private final ModelResourceIssueSynchronizer issueSynchronizer = new ModelResourceIssueSynchronizer(
+ private ModelResourceIssueSynchronizer issueSynchronizer = new ModelResourceIssueSynchronizer(
validationIssueManager);
- private final EditorChangeTracker editorChangeTracker = new EditorChangeTracker();
+ private EditorChangeTracker editorChangeTracker = new EditorChangeTracker();
public EditorChangeTracker getEditorChangeTracker()
{
@@ -250,6 +249,11 @@ public class WorkflowModelEditor extends AbstractMultiPageGraphicalEditor
modelServer.dispose();
}
variableContextHelper.removeContext(this.getWorkflowModel());
+ validationIssueManager = null;
+ issueSynchronizer = null;
+ cwmModel = null;
+ modelManager = null;
+ editorChangeTracker = null;
super.dispose();
}
diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/WorkflowModelEditorContextMenuProvider.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/WorkflowModelEditorContextMenuProvider.java
index b3c5ef8..9fc9460 100644
--- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/WorkflowModelEditorContextMenuProvider.java
+++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/WorkflowModelEditorContextMenuProvider.java
@@ -101,9 +101,10 @@ import org.eclipse.stardust.modeling.repository.common.IObjectDescriptor;
import org.eclipse.stardust.modeling.repository.common.ObjectRepositoryActivator;
public class WorkflowModelEditorContextMenuProvider extends ContextMenuProvider {
- private final ActionRegistry registry;
- private final ActionRegistry localRegistry;
+ private ActionRegistry registry;
+
+ private ActionRegistry localRegistry;
private WorkflowModelEditor editor;
@@ -354,8 +355,8 @@ public class WorkflowModelEditorContextMenuProvider extends ContextMenuProvider
GEFActionConstants.GROUP_EDIT);
addActionToMenu(manager, DiagramActionConstants.CONVERT_GATEWAYS,
- GEFActionConstants.GROUP_EDIT);
-
+ GEFActionConstants.GROUP_EDIT);
+
if (!editor.requireLock(modelElement == null ? connectionSymbol
: modelElement)) {
addSubMenuToMenu(manager, createAlignSubmenu(),
@@ -1083,4 +1084,19 @@ public class WorkflowModelEditorContextMenuProvider extends ContextMenuProvider
command.execute();
}
}
+
+ public void dispose()
+ {
+ if (registry != null)
+ {
+ registry.dispose();
+ registry = null;
+ }
+ if (localRegistry != null)
+ {
+ localRegistry.dispose();
+ localRegistry = null;
+ }
+ super.dispose();
+ }
} \ No newline at end of file
diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/diagram/actions/CreateApplicationAction.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/diagram/actions/CreateApplicationAction.java
index d9a36e9..b829ab8 100644
--- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/diagram/actions/CreateApplicationAction.java
+++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/diagram/actions/CreateApplicationAction.java
@@ -50,6 +50,12 @@ public class CreateApplicationAction extends SelectionAction
private ApplicationType application;
+ public void dispose()
+ {
+ this.setWorkbenchPart(null);
+ super.dispose();
+ }
+
public CreateApplicationAction(IConfigurationElement config, WorkflowModelEditor part)
{
super(part);
diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/diagram/actions/ForwardDeleteAction.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/diagram/actions/ForwardDeleteAction.java
index 3c636b7..2d5a75f 100644
--- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/diagram/actions/ForwardDeleteAction.java
+++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/diagram/actions/ForwardDeleteAction.java
@@ -22,7 +22,13 @@ import org.eclipse.ui.actions.ActionFactory;
public class ForwardDeleteAction extends SelectionAction
{
- private final ActionRegistry registry;
+ private ActionRegistry registry;
+
+ public void dispose()
+ {
+ registry = null;
+ super.dispose();
+ }
public ForwardDeleteAction(IWorkbenchPart part, ActionRegistry registry)
{
diff --git a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/tree/ModelTreeEditPart.java b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/tree/ModelTreeEditPart.java
index bb30076..c616cde 100644
--- a/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/tree/ModelTreeEditPart.java
+++ b/modeling/org.eclipse.stardust.modeling.core/src/org/eclipse/stardust/modeling/core/editors/parts/tree/ModelTreeEditPart.java
@@ -47,6 +47,13 @@ import org.eclipse.ui.PartInitException;
public class ModelTreeEditPart extends AbstractEObjectTreeEditPart
{
+ @Override
+ protected void finalize() throws Throwable
+ {
+ // TODO Auto-generated method stub
+ super.finalize();
+ }
+
private static final CarnotWorkflowModelPackage PKG_CWM = CarnotWorkflowModelPackage.eINSTANCE;
private ChildCategoryNode.Spec catApplications;
@@ -63,21 +70,21 @@ public class ModelTreeEditPart extends AbstractEObjectTreeEditPart
IIdentifiableModelElement parent = ModelUtils.getIdentifiableModelProxy(model, ModelType.class);
ValidationIssueManager manager = ((WorkflowModelEditor) getEditor()).getIssueManager();
-
+
catApplications = new ChildCategoryNode.Spec(parent,
Diagram_Messages.LB_Applications, editor.getIconFactory().getIconFor(PKG_CWM.getApplicationType()),
new EStructuralFeature[] {PKG_CWM.getModelType_Application()});
catData = new ChildCategoryNode.Spec(parent,
Diagram_Messages.DATA_LABEL, editor.getIconFactory().getIconFor(PKG_CWM.getDataType()),
- new EStructuralFeature[] {PKG_CWM.getModelType_Data()});
+ new EStructuralFeature[] {PKG_CWM.getModelType_Data()});
catParticipants = new ChildCategoryNode.Spec(parent,
Diagram_Messages.LB_Participants, editor.getIconFactory().getIconFor(PKG_CWM.getIModelParticipant()),
new EStructuralFeature[] {
PKG_CWM.getModelType_Organization(), PKG_CWM.getModelType_Role(),
PKG_CWM.getModelType_ConditionalPerformer(),
PKG_CWM.getModelType_Modeler()});
- manager.addValidationEventListener(catApplications);
- manager.addValidationEventListener(catData);
+ manager.addValidationEventListener(catApplications);
+ manager.addValidationEventListener(catData);
manager.addValidationEventListener(catParticipants);
if (hasConnectionExtensions())
{
@@ -110,8 +117,8 @@ public class ModelTreeEditPart extends AbstractEObjectTreeEditPart
protected void showCurrentEditValue(DirectEditRequest request)
{
- }
- });
+ }
+ });
}
public void performRequest(Request req)
@@ -132,7 +139,7 @@ public class ModelTreeEditPart extends AbstractEObjectTreeEditPart
}
super.performRequest(req);
}
-
+
public String getLabel()
{
return ((ModelType) getModel()).getName();
@@ -175,8 +182,8 @@ public class ModelTreeEditPart extends AbstractEObjectTreeEditPart
public void handleNotification(Notification n)
{
super.handleNotification(n);
- // when replacing Objects via Collision merge
- // we must close all affected Diagrams
+ // when replacing Objects via Collision merge
+ // we must close all affected Diagrams
if (n != null && PKG_CWM.getModelType_ProcessDefinition().equals(n.getFeature()))
{
if(n.getEventType() == Notification.SET)
@@ -185,18 +192,18 @@ public class ModelTreeEditPart extends AbstractEObjectTreeEditPart
EList<DiagramType> diagrams = process.getDiagram();
for (DiagramType diagramType : diagrams)
{
- getEditor().closeDiagramPage(diagramType);
+ getEditor().closeDiagramPage(diagramType);
}
}
- }
+ }
else if (n != null && PKG_CWM.getModelType_Diagram().equals(n.getFeature()))
{
if(n.getEventType() == Notification.SET)
{
DiagramType diagram = (DiagramType) n.getOldValue();
DiagramType activeDiagram = getEditor().getActiveDiagram();
- getEditor().closeDiagramPage(diagram);
-
+ getEditor().closeDiagramPage(diagram);
+
if(activeDiagram != null && activeDiagram.equals(diagram))
{
try
@@ -206,9 +213,9 @@ public class ModelTreeEditPart extends AbstractEObjectTreeEditPart
catch (PartInitException e)
{
// do nothing
- }
+ }
}
- }
+ }
}
}
} \ No newline at end of file