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