Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-03-26 18:27:29 +0000
committerChristian W. Damus2014-03-26 18:27:39 +0000
commitd1fa11d421e36d2eef220b8e20ae5ac347868150 (patch)
treef37efef01f7eacf0078707c414014ee57ca174db /extraplugins
parent3ce2e7826279d3ef2e39a0904bad9c9e1fdbe721 (diff)
downloadorg.eclipse.papyrus-d1fa11d421e36d2eef220b8e20ae5ac347868150.tar.gz
org.eclipse.papyrus-d1fa11d421e36d2eef220b8e20ae5ac347868150.tar.xz
org.eclipse.papyrus-d1fa11d421e36d2eef220b8e20ae5ac347868150.zip
392301: Colors are leaked
https://bugs.eclipse.org/bugs/show_bug.cgi?id=392301 Update editor factories in extra plugins for new IPageModel API.
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/factory/PapyrusCDTEditorFactory.java8
-rw-r--r--extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/LayersTreeDiagramEditorFactory.java26
2 files changed, 27 insertions, 7 deletions
diff --git a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/factory/PapyrusCDTEditorFactory.java b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/factory/PapyrusCDTEditorFactory.java
index 9f31853b7ca..a2103edd843 100644
--- a/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/factory/PapyrusCDTEditorFactory.java
+++ b/extraplugins/codegen/org.eclipse.papyrus.texteditor.cdt/src/org/eclipse/papyrus/texteditor/cdt/factory/PapyrusCDTEditorFactory.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
+ * Copyright (c) 2013, 2014 CEA LIST and others.
*
*
* All rights reserved. This program and the accompanying materials
@@ -10,6 +10,7 @@
* Contributors:
* Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
* Ansgar Radermacher (CEA LIST) - Minor adaptations
+ * Christian W. Damus (CEA) - bug 392301
*
*****************************************************************************/
package org.eclipse.papyrus.texteditor.cdt.factory;
@@ -193,5 +194,10 @@ public class PapyrusCDTEditorFactory extends AbstractEditorFactory {
public String getTabTitle() {
return rawEditorModel.getName();
}
+
+ @Override
+ public void dispose() {
+ // Pass. The tab icon is a plugin-shared image
+ }
}
}
diff --git a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/LayersTreeDiagramEditorFactory.java b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/LayersTreeDiagramEditorFactory.java
index 6ccae15f1bf..394758f2cb9 100644
--- a/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/LayersTreeDiagramEditorFactory.java
+++ b/extraplugins/layers/org.eclipse.papyrus.layers.stackmodel.diagram/src/org/eclipse/papyrus/layers/stackmodel/diagram/LayersTreeDiagramEditorFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 CEA LIST.
+ * Copyright (c) 2013, 2014 LIFL, CEA LIST, 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
@@ -7,6 +7,8 @@
*
* Contributors:
* Cedric Dumoulin - cedric.dumoulin@lifl.fr
+ * Christian W. Damus (CEA) - bug 392301
+ *
******************************************************************************/
package org.eclipse.papyrus.layers.stackmodel.diagram;
@@ -105,6 +107,8 @@ public class LayersTreeDiagramEditorFactory implements IPluggableEditorFactory {
private Diagram pageIdentifier;
private ServicesRegistry servicesRegistry;
+
+ private Image tabIcon;
/**
*
@@ -185,12 +189,14 @@ public class LayersTreeDiagramEditorFactory implements IPluggableEditorFactory {
*
*/
public Image getTabIcon() {
- ImageDescriptor imageDescriptor = editorDescriptor.getIcon();
- if(imageDescriptor == null) {
- return null;
+ if(tabIcon == null) {
+ ImageDescriptor imageDescriptor = editorDescriptor.getIcon();
+ if(imageDescriptor != null) {
+ tabIcon = imageDescriptor.createImage();
+ }
}
-
- return imageDescriptor.createImage();
+
+ return tabIcon;
}
/**
@@ -202,6 +208,14 @@ public class LayersTreeDiagramEditorFactory implements IPluggableEditorFactory {
public String getTabTitle() {
return "Layers Tree Editor";
}
+
+ @Override
+ public void dispose() {
+ if(tabIcon != null) {
+ tabIcon.dispose();
+ tabIcon = null;
+ }
+ }
}
}

Back to the top