Moving editor sources back into trunk
[taxeditor.git] / taxeditor-store / src / main / java / eu / etaxonomy / taxeditor / store / internal / TaxeditorStorePlugin.java
1 package eu.etaxonomy.taxeditor.store.internal;
2
3 import org.apache.log4j.Logger;
4 import org.eclipse.jface.resource.ImageDescriptor;
5 import org.eclipse.jface.resource.ImageRegistry;
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 TaxeditorStorePlugin extends AbstractUIPlugin {
13
14 public static final Logger logger = Logger.getLogger(TaxeditorStorePlugin.class);
15
16 // The plug-in ID
17 public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.editor";
18
19 // The shared instance
20 private static TaxeditorStorePlugin plugin;
21
22 /**
23 * The constructor
24 */
25 public TaxeditorStorePlugin() {
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 logger.trace("Plugin started: " + this.getBundle().getSymbolicName());
36 }
37
38 /*
39 * (non-Javadoc)
40 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
41 */
42 public void stop(BundleContext context) throws Exception {
43 plugin = null;
44 super.stop(context);
45 logger.trace("Plugin stopped");
46 }
47
48 /**
49 * Returns the shared instance
50 *
51 * @return the shared instance
52 */
53 public static TaxeditorStorePlugin getDefault() {
54 return plugin;
55 }
56
57 /**
58 * Returns an image descriptor for the image file at the given
59 * plug-in relative path
60 *
61 * @param path the path
62 * @return the image descriptor
63 */
64 public static ImageDescriptor getImageDescriptor(String path) {
65 return imageDescriptorFromPlugin(PLUGIN_ID, path);
66 }
67
68
69 /**
70 * Exposes this normally protected method.
71 */
72 public ImageRegistry createImageRegistry(){
73 return super.createImageRegistry();
74 }
75
76 /************************ ERROR CODES ****************************/
77
78 /**
79 * An attempt was made to save a taxon with a zero length name
80 */
81 public static final int ERROR_SAVING_ZERO_NAME = 52000;
82 }