Project

General

Profile

Download (2.16 KB) Statistics
| Branch: | Tag: | Revision:
1
package eu.etaxonomy.taxeditor.singlesource.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
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
10

    
11
/**
12
 * The activator class controls the plug-in life cycle
13
 *
14
 * @author n.hoffmann
15
 * @version $Id: $
16
 */
17
public class TaxeditorStorePlugin extends AbstractUIPlugin {
18
	private static final Logger logger = Logger.getLogger(TaxeditorStorePlugin.class);
19
	// The plug-in ID
20
	/** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.editor"</code> */
21
	public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.editor";
22

    
23
	// The shared instance
24
	private static TaxeditorStorePlugin plugin;
25
	
26
	/**
27
	 * The constructor
28
	 */
29
	public TaxeditorStorePlugin() {
30
	}
31

    
32
	/*
33
	 * (non-Javadoc)
34
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
35
	 */
36
	/** {@inheritDoc} */
37
	public void start(BundleContext context) throws Exception {
38
		super.start(context);
39
		
40
		plugin = this;
41
		logger.debug("TaxeditorStorePlugin.start(BundleContext)");
42
/** RAPSS: Must be moved to session Context e.g. EntryPoint.createUI().*/
43
//		PreferencesUtil.setDefaults();
44
	}
45

    
46
	/*
47
	 * (non-Javadoc)
48
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
49
	 */
50
	/** {@inheritDoc} */
51
	public void stop(BundleContext context) throws Exception {
52
		plugin = null;
53
		super.stop(context);
54
	}
55

    
56
	/**
57
	 * Returns the shared instance
58
	 *
59
	 * @return the shared instance
60
	 */
61
	public static TaxeditorStorePlugin getDefault() {
62
		return plugin;
63
	}
64
	
65
	/**
66
	 * Returns an image descriptor for the image file at the given
67
	 * plug-in relative path
68
	 *
69
	 * @param path the path
70
	 * @return the image descriptor
71
	 */
72
	public static ImageDescriptor getImageDescriptor(String path) {
73
		return imageDescriptorFromPlugin(PLUGIN_ID, path);
74
	}
75
	
76
	
77
	/**
78
	 * Exposes this normally protected method.
79
	 *
80
	 * @return a {@link org.eclipse.jface.resource.ImageRegistry} object.
81
	 */
82
	public ImageRegistry createImageRegistry(){
83
		return super.createImageRegistry();
84
	}
85
}
    (1-1/1)