]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.document.linking.ui/src/org/simantics/document/linking/Activator.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.document.linking.ui / src / org / simantics / document / linking / Activator.java
1 package org.simantics.document.linking;\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         public ImageDescriptor cross;\r
13         public ImageDescriptor clock_red;\r
14 \r
15         // The plug-in ID\r
16         public static final String PLUGIN_ID = "org.simantics.document.linking.ui"; //$NON-NLS-1$\r
17 \r
18         // The shared instance\r
19         private static Activator plugin;\r
20         \r
21         /**\r
22          * The constructor\r
23          */\r
24         public Activator() {\r
25         }\r
26 \r
27         /*\r
28          * (non-Javadoc)\r
29          * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)\r
30          */\r
31         public void start(BundleContext context) throws Exception {\r
32                 super.start(context);\r
33                 plugin = this;\r
34                 cross = imageDescriptorFromPlugin(PLUGIN_ID, "icons/silk_small/cross.png");\r
35                 clock_red = imageDescriptorFromPlugin(PLUGIN_ID, "icons/silk_small/clock_red.png");\r
36         }\r
37 \r
38         /*\r
39          * (non-Javadoc)\r
40          * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)\r
41          */\r
42         public void stop(BundleContext context) throws Exception {\r
43                 plugin = null;\r
44                 super.stop(context);\r
45         }\r
46 \r
47         /**\r
48          * Returns the shared instance\r
49          *\r
50          * @return the shared instance\r
51          */\r
52         public static Activator getDefault() {\r
53                 return plugin;\r
54         }\r
55 \r
56 }\r