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