1 | package de.uka.ipd.sdq.pcmsolver; |
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 Activator extends AbstractUIPlugin { |
11 | |
12 | // The plug-in ID |
13 | public static final String PLUGIN_ID = "pcmsolver_plugin"; |
14 | |
15 | // The shared instance |
16 | private static Activator plugin; |
17 | |
18 | /** |
19 | * The constructor |
20 | */ |
21 | public Activator() { |
22 | } |
23 | |
24 | /* |
25 | * (non-Javadoc) |
26 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) |
27 | */ |
28 | @Override |
29 | public void start(BundleContext context) throws Exception { |
30 | super.start(context); |
31 | plugin = this; |
32 | } |
33 | |
34 | /* |
35 | * (non-Javadoc) |
36 | * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) |
37 | */ |
38 | @Override |
39 | public void stop(BundleContext context) throws Exception { |
40 | plugin = null; |
41 | super.stop(context); |
42 | } |
43 | |
44 | /** |
45 | * Returns the shared instance |
46 | * |
47 | * @return the shared instance |
48 | */ |
49 | public static Activator getDefault() { |
50 | return plugin; |
51 | } |
52 | |
53 | /** |
54 | * Returns an image descriptor for the image file at the given |
55 | * plug-in relative path |
56 | * |
57 | * @param path the path |
58 | * @return the image descriptor |
59 | */ |
60 | public static ImageDescriptor getImageDescriptor(String path) { |
61 | return imageDescriptorFromPlugin(PLUGIN_ID, path); |
62 | } |
63 | } |