1360
|
1 |
package com.nokia.carbide.discovery.ui;
|
|
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 |
// The plug-in ID
|
|
12 |
public static final String PLUGIN_ID = "com.nokia.carbide.discovery.ui"; //$NON-NLS-1$
|
|
13 |
|
|
14 |
// The shared instance
|
|
15 |
private static Activator plugin;
|
|
16 |
|
|
17 |
/**
|
|
18 |
* The constructor
|
|
19 |
*/
|
|
20 |
public Activator() {
|
|
21 |
}
|
|
22 |
|
|
23 |
/*
|
|
24 |
* (non-Javadoc)
|
|
25 |
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
|
|
26 |
*/
|
|
27 |
public void start(BundleContext context) throws Exception {
|
|
28 |
super.start(context);
|
|
29 |
plugin = this;
|
|
30 |
}
|
|
31 |
|
|
32 |
/*
|
|
33 |
* (non-Javadoc)
|
|
34 |
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
|
|
35 |
*/
|
|
36 |
public void stop(BundleContext context) throws Exception {
|
|
37 |
plugin = null;
|
|
38 |
super.stop(context);
|
|
39 |
}
|
|
40 |
|
|
41 |
/**
|
|
42 |
* Returns the shared instance
|
|
43 |
*
|
|
44 |
* @return the shared instance
|
|
45 |
*/
|
|
46 |
public static Activator getDefault() {
|
|
47 |
return plugin;
|
|
48 |
}
|
|
49 |
|
|
50 |
/**
|
|
51 |
* Returns an image descriptor for the image file at the given
|
|
52 |
* plug-in relative path
|
|
53 |
*
|
|
54 |
* @param path the path
|
|
55 |
* @return the image descriptor
|
|
56 |
*/
|
|
57 |
public static ImageDescriptor getImageDescriptor(String path) {
|
|
58 |
return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
|
59 |
}
|
|
60 |
}
|