]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.selectionview.ui.ontology/src/org/simantics/selectionview/ui/ontology/Activator.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.selectionview.ui.ontology / src / org / simantics / selectionview / ui / ontology / Activator.java
1 package org.simantics.selectionview.ui.ontology;\r
2 \r
3 import org.eclipse.jface.resource.ImageDescriptor;\r
4 import org.eclipse.ui.plugin.AbstractUIPlugin;\r
5 import org.osgi.framework.BundleContext;\r
6 \r
7 /**\r
8  * The activator class controls the plug-in life cycle\r
9  */\r
10 public class Activator extends AbstractUIPlugin {\r
11 \r
12         // The plug-in ID\r
13         public static final String PLUGIN_ID = "org.simantics.selectionview.ui.ontology"; //$NON-NLS-1$\r
14 \r
15         // The shared instance\r
16         private static Activator plugin;\r
17         \r
18         /**\r
19          * The constructor\r
20          */\r
21         public Activator() {\r
22         }\r
23 \r
24         /*\r
25          * (non-Javadoc)\r
26          * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)\r
27          */\r
28         public void start(BundleContext context) throws Exception {\r
29                 super.start(context);\r
30                 plugin = this;\r
31         }\r
32 \r
33         /*\r
34          * (non-Javadoc)\r
35          * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)\r
36          */\r
37         public void stop(BundleContext context) throws Exception {\r
38                 plugin = null;\r
39                 super.stop(context);\r
40         }\r
41 \r
42         /**\r
43          * Returns the shared instance\r
44          *\r
45          * @return the shared instance\r
46          */\r
47         public static Activator getDefault() {\r
48                 return plugin;\r
49         }\r
50 \r
51         /**\r
52          * Returns an image descriptor for the image file at the given\r
53          * plug-in relative path\r
54          *\r
55          * @param path the path\r
56          * @return the image descriptor\r
57          */\r
58         public static ImageDescriptor getImageDescriptor(String path) {\r
59                 return imageDescriptorFromPlugin(PLUGIN_ID, path);\r
60         }\r
61 }\r