Project

General

Profile

Download (1.88 KB) Statistics
| Branch: | Tag: | Revision:
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.editor.UseObjectManager;
9
import eu.etaxonomy.taxeditor.store.CdmStore;
10

    
11
/**
12
 * The activator class controls the plug-in life cycle
13
 *
14
 * @author n.hoffmann
15
 * @version $Id: $
16
 */
17
public class TaxeditorEditorPlugin extends AbstractUIPlugin {
18

    
19
	/** Constant <code>logger</code> */
20
	public static final Logger logger = Logger.getLogger(TaxeditorEditorPlugin.class);
21
	
22
	// The plug-in ID
23
	/** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.editor"</code> */
24
	public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.editor";
25

    
26
	// The shared instance
27
	private static TaxeditorEditorPlugin plugin;
28
	
29
	/**
30
	 * The constructor
31
	 */
32
	public TaxeditorEditorPlugin() {
33
	}
34

    
35
	/*
36
	 * (non-Javadoc)
37
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
38
	 */
39
	/** {@inheritDoc} */
40
	public void start(BundleContext context) throws Exception {
41
		super.start(context);
42
		
43
		EditorStateManager stateManager = new EditorStateManager();
44
		CdmStore.getContextManager().addContextListener(stateManager);
45
		
46
		UseObjectManager useManager = new UseObjectManager();
47
		CdmStore.getContextManager().addContextListener(useManager);
48
		
49
		plugin = this;
50
		logger.trace("Plugin started: " + this.getBundle().getSymbolicName());
51
	}
52

    
53
	/*
54
	 * (non-Javadoc)
55
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
56
	 */
57
	/** {@inheritDoc} */
58
	public void stop(BundleContext context) throws Exception {
59
		plugin = null;
60
		super.stop(context);
61
		logger.trace("Plugin stopped");
62
	}
63

    
64
	/**
65
	 * Returns the shared instance
66
	 *
67
	 * @return the shared instance
68
	 */
69
	public static TaxeditorEditorPlugin getDefault() {
70
		return plugin;
71
	}
72
}
    (1-1/1)