1
|
1 package de.mpg.mpiwg.itgroup.digilib.plugin;
|
|
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 = "de.mpg.mpiwg.itgroup.diglib.plugin"; //$NON-NLS-1$
|
22
|
14
|
|
15 //default base url fuer preferences
|
23
|
16
|
1
|
17 // The shared instance
|
|
18 private static Activator plugin;
|
|
19
|
|
20 /**
|
|
21 * The constructor
|
|
22 */
|
|
23 public Activator() {
|
|
24 }
|
|
25
|
|
26 /*
|
|
27 * (non-Javadoc)
|
|
28 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
|
29 */
|
|
30 public void start(BundleContext context) throws Exception {
|
|
31 super.start(context);
|
|
32 plugin = this;
|
|
33 }
|
|
34
|
|
35 /*
|
|
36 * (non-Javadoc)
|
|
37 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
|
38 */
|
|
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 }
|
22
|
63
|
23
|
64
|
1
|
65 }
|