Project

General

Profile

Download (1.86 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.editor.validation.ValidationContextListener;
10
import eu.etaxonomy.taxeditor.store.CdmStore;
11

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

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

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

    
36
	/** {@inheritDoc} */
37
	public void start(BundleContext context) throws Exception {
38
		super.start(context);
39
		
40
		EditorStateManager stateManager = new EditorStateManager();
41
		CdmStore.getContextManager().addContextListener(stateManager);
42
		
43
		UseObjectManager useManager = new UseObjectManager();  	 	 
44
		CdmStore.getContextManager().addContextListener(useManager);
45
		
46
		ValidationContextListener vcl = new ValidationContextListener();
47
//		CdmStore.getContextManager().addContextListener(vcl);
48
		
49
		plugin = this;
50
		logger.trace("Plugin started: " + this.getBundle().getSymbolicName());
51
	}
52

    
53

    
54
	/** {@inheritDoc} */
55
	public void stop(BundleContext context) throws Exception {
56
		plugin = null;
57
		super.stop(context);
58
		logger.trace("Plugin stopped");
59
	}
60

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