automated build configuration is on its way
[taxeditor.git] / taxeditor-editor / src / main / java / eu / etaxonomy / taxeditor / editor / internal / TaxeditorEditorPlugin.java
1 package eu.etaxonomy.taxeditor.editor.internal;
2
3 import org.apache.log4j.Logger;
4 import org.eclipse.ui.plugin.AbstractUIPlugin;
5 import org.osgi.framework.BundleContext;
6
7 import eu.etaxonomy.taxeditor.editor.EditorStateManager;
8 import eu.etaxonomy.taxeditor.store.CdmStore;
9
10 /**
11 * The activator class controls the plug-in life cycle
12 *
13 * @author n.hoffmann
14 * @version $Id: $
15 */
16 public class TaxeditorEditorPlugin extends AbstractUIPlugin {
17
18 /** Constant <code>logger</code> */
19 public static final Logger logger = Logger.getLogger(TaxeditorEditorPlugin.class);
20
21 // The plug-in ID
22 /** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.editor"</code> */
23 public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.editor";
24
25 // The shared instance
26 private static TaxeditorEditorPlugin plugin;
27
28 /**
29 * The constructor
30 */
31 public TaxeditorEditorPlugin() {
32 }
33
34 /*
35 * (non-Javadoc)
36 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
37 */
38 /** {@inheritDoc} */
39 public void start(BundleContext context) throws Exception {
40 super.start(context);
41
42 EditorStateManager stateManager = new EditorStateManager();
43 CdmStore.getContextManager().addContextListener(stateManager);
44
45 plugin = this;
46 logger.trace("Plugin started: " + this.getBundle().getSymbolicName());
47 }
48
49 /*
50 * (non-Javadoc)
51 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
52 */
53 /** {@inheritDoc} */
54 public void stop(BundleContext context) throws Exception {
55 plugin = null;
56 super.stop(context);
57 logger.trace("Plugin stopped");
58 }
59
60 /**
61 * Returns the shared instance
62 *
63 * @return the shared instance
64 */
65 public static TaxeditorEditorPlugin getDefault() {
66 return plugin;
67 }
68 }