Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2017-08-17 19:15:22 +0000
committerAnsgar Radermacher2017-08-18 16:22:41 +0000
commitcc970f662d63f8d2be9c8b97e8e37cb597eff8f6 (patch)
tree5295140b1b4d22605c2c9c5e18c3a2f1dc212b61
parent70b9982a746b386c76351a81b2f263bb87fecd88 (diff)
downloadorg.eclipse.papyrus-cc970f662d63f8d2be9c8b97e8e37cb597eff8f6.tar.gz
org.eclipse.papyrus-cc970f662d63f8d2be9c8b97e8e37cb597eff8f6.tar.xz
org.eclipse.papyrus-cc970f662d63f8d2be9c8b97e8e37cb597eff8f6.zip
Bug 519107 - [All diagrams] model opening is slow, if multiple diagrams are open
- Avoid NPE on dispose (if diagram has not been initialized yet) - Add bug-related entry in header Signed-off-by: Ansgar Radermacher <ansgar.radermacher@cea.fr> (cherry picked from commit 6d2a9e6738ed35ddba11aa520595e17cd1f47f45) Change-Id: I1aaf9a6bb651073afd140192967feead50c4450d
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UmlGmfDiagramEditor.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UmlGmfDiagramEditor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UmlGmfDiagramEditor.java
index 72d7d380169..0e7f08d6626 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UmlGmfDiagramEditor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UmlGmfDiagramEditor.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2016, 2017 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -9,6 +9,7 @@
* Contributors:
* CEA LIST - Initial API and implementation
* Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905
+ * Ansgar Radermacher (CEA) ansgar.radermacher@cea.fr - Bug 519107 (lazy diagram opening)
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.common.part;
@@ -128,6 +129,18 @@ public class UmlGmfDiagramEditor extends SynchronizableGmfDiagramEditor implemen
}
/**
+ * Avoid NPE, if viewer has not been initialized yet (method is called on dispose)
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor#persistViewerSettings()
+ */
+ @Override
+ public void persistViewerSettings() {
+ if (getDiagramEditPart() != null) {
+ super.persistViewerSettings();
+ }
+ }
+
+ /**
* Dispose services used in this part.
*
* @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#dispose()
@@ -309,10 +322,10 @@ public class UmlGmfDiagramEditor extends SynchronizableGmfDiagramEditor implemen
public void modifyPartName(final String name) {
setPartName(name);
}
-
+
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.papyrus.infra.internationalization.common.editor.IInternationalizationEditor#refreshEditorPart()
*/
@Override

Back to the top