28
|
1 package de.mpg.mpiwg.itgroup.digilib.core.plugin;
|
1
|
2
|
|
3 import org.eclipse.jface.resource.ImageDescriptor;
|
|
4 import org.eclipse.ui.plugin.AbstractUIPlugin;
|
|
5 import org.osgi.framework.BundleContext;
|
|
6
|
28
|
7
|
1
|
8 /**
|
|
9 * The activator class controls the plug-in life cycle
|
|
10 */
|
|
11 public class Activator extends AbstractUIPlugin {
|
|
12
|
|
13 // The plug-in ID
|
28
|
14 public static final String PLUGIN_ID = "de.mpg.mpiwg.itgroup.digilib.core"; //$NON-NLS-1$
|
22
|
15
|
|
16 //default base url fuer preferences
|
23
|
17
|
1
|
18 // The shared instance
|
|
19 private static Activator plugin;
|
|
20
|
|
21 /**
|
|
22 * The constructor
|
|
23 */
|
|
24 public Activator() {
|
|
25 }
|
|
26
|
|
27 /*
|
|
28 * (non-Javadoc)
|
|
29 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
|
30 */
|
|
31 public void start(BundleContext context) throws Exception {
|
|
32 super.start(context);
|
|
33 plugin = this;
|
|
34 }
|
|
35
|
|
36 /*
|
|
37 * (non-Javadoc)
|
|
38 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
|
39 */
|
|
40 public void stop(BundleContext context) throws Exception {
|
|
41 plugin = null;
|
|
42 super.stop(context);
|
|
43 }
|
|
44
|
|
45 /**
|
|
46 * Returns the shared instance
|
|
47 *
|
|
48 * @return the shared instance
|
|
49 */
|
|
50 public static Activator getDefault() {
|
|
51 return plugin;
|
|
52 }
|
|
53
|
|
54 /**
|
|
55 * Returns an image descriptor for the image file at the given
|
|
56 * plug-in relative path
|
|
57 *
|
|
58 * @param path the path
|
|
59 * @return the image descriptor
|
|
60 */
|
|
61 public static ImageDescriptor getImageDescriptor(String path) {
|
|
62 return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
|
63 }
|
22
|
64
|
23
|
65
|
1
|
66 }
|