Project

General

Profile

Download (1.73 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.UseObjectManager;
8
import eu.etaxonomy.taxeditor.editor.validation.ValidationContextListener;
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"; //$NON-NLS-1$
25

    
26
	// The shared instance
27
	private static TaxeditorEditorPlugin plugin;
28

    
29
	/**
30
	 * The constructor
31
	 */
32
	public TaxeditorEditorPlugin() {
33
	}
34

    
35
	/** {@inheritDoc} */
36
	@Override
37
    public void start(BundleContext context) throws Exception {
38
		super.start(context);
39

    
40
		UseObjectManager useManager = new UseObjectManager();
41
		CdmStore.getContextManager().addContextListener(useManager);
42

    
43
		ValidationContextListener vcl = new ValidationContextListener();
44
//		CdmStore.getContextManager().addContextListener(vcl);
45

    
46
		plugin = this;
47
		logger.trace("Plugin started: " + this.getBundle().getSymbolicName()); //$NON-NLS-1$
48
	}
49

    
50

    
51
	/** {@inheritDoc} */
52
	@Override
53
    public void stop(BundleContext context) throws Exception {
54
		plugin = null;
55
		super.stop(context);
56
		logger.trace("Plugin stopped"); //$NON-NLS-1$
57
	}
58

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