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