| 1 | package de.uka.ipd.sdq.sensorframework.visualisation; |
| 2 | |
| 3 | import org.eclipse.jface.resource.ImageDescriptor; |
| 4 | import org.eclipse.ui.plugin.AbstractUIPlugin; |
| 5 | import org.osgi.framework.BundleContext; |
| 6 | |
| 7 | /** |
| 8 | * The activator class controls the plug-in life cycle |
| 9 | */ |
| 10 | public class VisualisationPlugin extends AbstractUIPlugin { |
| 11 | |
| 12 | // The plug-in ID |
| 13 | public static final String PLUGIN_ID = "de.uka.ipd.sdq.sensorframework.visualisation"; |
| 14 | // The filtered measurements factory ID |
| 15 | public static final String FILTER_FACTORY_ID = "FilteredMeasurementsFactory"; |
| 16 | |
| 17 | // The shared instance |
| 18 | private static VisualisationPlugin plugin; |
| 19 | |
| 20 | /** |
| 21 | * The constructor |
| 22 | */ |
| 23 | public VisualisationPlugin() { |
| 24 | plugin = this; |
| 25 | } |
| 26 | |
| 27 | /* |
| 28 | * (non-Javadoc) |
| 29 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) |
| 30 | */ |
| 31 | @Override |
| 32 | public void start(BundleContext context) throws Exception { |
| 33 | super.start(context); |
| 34 | } |
| 35 | |
| 36 | /* |
| 37 | * (non-Javadoc) |
| 38 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) |
| 39 | */ |
| 40 | @Override |
| 41 | public void stop(BundleContext context) throws Exception { |
| 42 | plugin = null; |
| 43 | super.stop(context); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Returns the shared instance |
| 48 | * |
| 49 | * @return the shared instance |
| 50 | */ |
| 51 | public static VisualisationPlugin getDefault() { |
| 52 | return plugin; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Returns an image descriptor for the image file at the given |
| 57 | * plug-in relative path |
| 58 | * |
| 59 | * @param path the path |
| 60 | * @return the image descriptor |
| 61 | */ |
| 62 | public static ImageDescriptor getImageDescriptor(String path) { |
| 63 | return imageDescriptorFromPlugin(PLUGIN_ID, path); |
| 64 | } |
| 65 | } |