1 package org.ginkgo.gcov;
3 import java.util.ArrayList;
5 import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
6 import org.eclipse.jface.resource.ImageDescriptor;
7 import org.eclipse.ui.plugin.AbstractUIPlugin;
8 import org.osgi.framework.BundleContext;
11 * The activator class controls the plug-in life cycle
13 public class GcovPlugin extends AbstractUIPlugin {
16 public static final String PLUGIN_ID = "org.ginkgo.gcov";
18 // The shared instance
19 private static GcovPlugin plugin;
20 private ArrayList myListeners;
25 myListeners=new ArrayList();
30 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
32 public void start(BundleContext context) throws Exception {
39 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
41 public void stop(BundleContext context) throws Exception {
47 * Returns the shared instance
49 * @return the shared instance
51 public static GcovPlugin getDefault() {
56 * Returns an image descriptor for the image file at the given
57 * plug-in relative path
59 * @param path the path
60 * @return the image descriptor
62 public static ImageDescriptor getImageDescriptor(String path) {
63 return imageDescriptorFromPlugin(PLUGIN_ID, path);
65 // A public method that allows listener registration
66 public void addPropertyChangeListener(IPropertyChangeListener listener) {
67 if(!myListeners.contains(listener))
68 myListeners.add(listener);
71 // A public method that allows listener registration
72 public void removePropertyChangeListener(IPropertyChangeListener listener) {
73 myListeners.remove(listener);
75 public ArrayList getMyListeners() {