From 3b2a7dd687a30405ef9f13a50e086c5790725cae Mon Sep 17 00:00:00 2001 From: Henrik Rentz-Reichert Date: Tue, 26 Jul 2011 21:03:58 +0200 Subject: [ui.behavior, ui.structure] bug fixes in Activators Change-Id: I94d14c7b86423151ad8d0904a9c84e42ad09ff81 --- .../src/org/eclipse/etrice/ui/behavior/Activator.java | 10 +++------- .../src/org/eclipse/etrice/ui/structure/Activator.java | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/Activator.java b/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/Activator.java index e384becdb..f3b1e2e41 100644 --- a/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/Activator.java +++ b/plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/Activator.java @@ -13,7 +13,6 @@ package org.eclipse.etrice.ui.behavior; import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.swt.graphics.Image; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; @@ -29,8 +28,6 @@ public class Activator extends AbstractUIPlugin { // The shared instance private static Activator plugin; - private ImageRegistry imageRegistry = new ImageRegistry(); - /** * The constructor */ @@ -51,7 +48,6 @@ public class Activator extends AbstractUIPlugin { * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) */ public void stop(BundleContext context) throws Exception { - plugin.imageRegistry.dispose(); plugin = null; super.stop(context); } @@ -74,14 +70,14 @@ public class Activator extends AbstractUIPlugin { * @return the image descriptor */ public static Image getImage(String path) { - Image img = getDefault().imageRegistry.get(path); + Image img = getDefault().getImageRegistry().get(path); if (img==null) { ImageDescriptor desc = imageDescriptorFromPlugin(PLUGIN_ID, path); if (desc==null) System.err.println("image not found: "+path); else { - getDefault().imageRegistry.put(path, desc); - getDefault().imageRegistry.get(path); + getDefault().getImageRegistry().put(path, desc); + getDefault().getImageRegistry().get(path); } } return img; diff --git a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/Activator.java b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/Activator.java index 67a23d44a..6b6ed7577 100644 --- a/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/Activator.java +++ b/plugins/org.eclipse.etrice.ui.structure/src/org/eclipse/etrice/ui/structure/Activator.java @@ -14,7 +14,6 @@ package org.eclipse.etrice.ui.structure; import org.osgi.framework.BundleContext; import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; import org.eclipse.swt.graphics.Image; import org.eclipse.ui.plugin.AbstractUIPlugin; @@ -26,8 +25,6 @@ public class Activator extends AbstractUIPlugin { // The plug-in ID public static final String PLUGIN_ID = "org.eclipse.etrice.ui.structure"; - private ImageRegistry imageRegistry = new ImageRegistry(); - /* * (non-Javadoc) * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) @@ -42,7 +39,6 @@ public class Activator extends AbstractUIPlugin { * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) */ public void stop(BundleContext context) throws Exception { - plugin.imageRegistry.dispose(); plugin = null; super.stop(context); } @@ -65,14 +61,14 @@ public class Activator extends AbstractUIPlugin { * @return the image descriptor */ public static Image getImage(String path) { - Image img = getDefault().imageRegistry.get(path); + Image img = getDefault().getImageRegistry().get(path); if (img==null) { ImageDescriptor desc = imageDescriptorFromPlugin(PLUGIN_ID, path); if (desc==null) System.err.println("image not found: "+path); else { - getDefault().imageRegistry.put(path, desc); - getDefault().imageRegistry.get(path); + getDefault().getImageRegistry().put(path, desc); + getDefault().getImageRegistry().get(path); } } return img; -- cgit v1.2.3