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