#4073 Add new project for lanuching embedded jetty server using cdmlib webapp
[taxeditor.git] / eu.etaxonomy.taxeditor.webapp / src / main / java / eu / etaxonomy / taxeditor / webapp / TaxeditorWebappPlugin.java
1 package eu.etaxonomy.taxeditor.webapp;
2
3 import org.eclipse.jface.resource.ImageDescriptor;
4 import org.eclipse.jface.resource.ImageRegistry;
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 * @author n.hoffmann
12 * @version $Id: $
13 */
14 public class TaxeditorWebappPlugin extends AbstractUIPlugin {
15
16 // The plug-in ID
17 /** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.editor"</code> */
18 public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.editor";
19
20 // The shared instance
21 private static TaxeditorWebappPlugin plugin;
22
23 /**
24 * The constructor
25 */
26 public TaxeditorWebappPlugin() {
27 }
28
29 /*
30 * (non-Javadoc)
31 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
32 */
33 /** {@inheritDoc} */
34 @Override
35 public void start(BundleContext context) throws Exception {
36 super.start(context);
37 plugin = this;
38 }
39
40 /*
41 * (non-Javadoc)
42 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
43 */
44 /** {@inheritDoc} */
45 @Override
46 public void stop(BundleContext context) throws Exception {
47 plugin = null;
48 super.stop(context);
49 }
50
51 /**
52 * Returns the shared instance
53 *
54 * @return the shared instance
55 */
56 public static TaxeditorWebappPlugin getDefault() {
57 return plugin;
58 }
59
60 /**
61 * Returns an image descriptor for the image file at the given
62 * plug-in relative path
63 *
64 * @param path the path
65 * @return the image descriptor
66 */
67 public static ImageDescriptor getImageDescriptor(String path) {
68 return imageDescriptorFromPlugin(PLUGIN_ID, path);
69 }
70
71
72 /**
73 * Exposes this normally protected method.
74 *
75 * @return a {@link org.eclipse.jface.resource.ImageRegistry} object.
76 */
77 @Override
78 public ImageRegistry createImageRegistry(){
79 return super.createImageRegistry();
80 }
81 }