1
|
1 package de.mpg.mpiwg.itgroup.digilib.plugin;
|
|
2
|
22
|
3 import org.eclipse.jface.preference.IPreferenceStore;
|
1
|
4 import org.eclipse.jface.resource.ImageDescriptor;
|
|
5 import org.eclipse.ui.plugin.AbstractUIPlugin;
|
|
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 = "de.mpg.mpiwg.itgroup.diglib.plugin"; //$NON-NLS-1$
|
22
|
15
|
|
16 //default base url fuer preferences
|
|
17 private static final String baseUrl_default="http://digilib.mpiwg-berlin.mpg.de/digitallibrary/servlet/Scaler";
|
|
18 public static String baseUrl_id="baseurl";
|
1
|
19 // The shared instance
|
|
20 private static Activator plugin;
|
|
21
|
|
22 /**
|
|
23 * The constructor
|
|
24 */
|
|
25 public Activator() {
|
|
26 }
|
|
27
|
|
28 /*
|
|
29 * (non-Javadoc)
|
|
30 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
|
31 */
|
|
32 public void start(BundleContext context) throws Exception {
|
|
33 super.start(context);
|
|
34 plugin = this;
|
|
35 }
|
|
36
|
|
37 /*
|
|
38 * (non-Javadoc)
|
|
39 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
|
40 */
|
|
41 public void stop(BundleContext context) throws Exception {
|
|
42 plugin = null;
|
|
43 super.stop(context);
|
|
44 }
|
|
45
|
|
46 /**
|
|
47 * Returns the shared instance
|
|
48 *
|
|
49 * @return the shared instance
|
|
50 */
|
|
51 public static Activator getDefault() {
|
|
52 return plugin;
|
|
53 }
|
|
54
|
|
55 /**
|
|
56 * Returns an image descriptor for the image file at the given
|
|
57 * plug-in relative path
|
|
58 *
|
|
59 * @param path the path
|
|
60 * @return the image descriptor
|
|
61 */
|
|
62 public static ImageDescriptor getImageDescriptor(String path) {
|
|
63 return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
|
64 }
|
22
|
65
|
|
66 /**
|
|
67 * Initializes a preference store with default preference values
|
|
68 * for this plug-in.
|
|
69 */
|
|
70 protected void initializeDefaultPreferences(IPreferenceStore store) {
|
|
71 store.setDefault(baseUrl_id, baseUrl_default);
|
|
72
|
|
73
|
|
74 }
|
1
|
75 }
|