1
|
package eu.etaxonomy.taxeditor.navigation.internal;
|
2
|
|
3
|
import org.eclipse.jface.resource.ImageDescriptor;
|
4
|
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
5
|
import org.osgi.framework.BundleContext;
|
6
|
|
7
|
import eu.etaxonomy.taxeditor.navigation.NavigatorStateManager;
|
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
|
*/
|
15
|
public class TaxeditorNavigationPlugin extends AbstractUIPlugin {
|
16
|
|
17
|
// The plug-in ID
|
18
|
/** Constant <code>PLUGIN_ID="eu.etaxonomy.taxeditor.navigator"</code> */
|
19
|
public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.navigator"; //$NON-NLS-1$
|
20
|
|
21
|
// The shared instance
|
22
|
private static TaxeditorNavigationPlugin plugin;
|
23
|
|
24
|
/**
|
25
|
* The constructor
|
26
|
*/
|
27
|
public TaxeditorNavigationPlugin() {
|
28
|
}
|
29
|
|
30
|
@Override
|
31
|
public void start(BundleContext context) throws Exception {
|
32
|
super.start(context);
|
33
|
|
34
|
NavigatorStateManager stateManager = new NavigatorStateManager();
|
35
|
CdmStore.getContextManager().addContextListener(stateManager);
|
36
|
plugin = this;
|
37
|
}
|
38
|
|
39
|
@Override
|
40
|
public void stop(BundleContext context) throws Exception {
|
41
|
plugin = null;
|
42
|
super.stop(context);
|
43
|
}
|
44
|
|
45
|
/**
|
46
|
* Returns the shared instance
|
47
|
*
|
48
|
* @return the shared instance
|
49
|
*/
|
50
|
public static TaxeditorNavigationPlugin getDefault() {
|
51
|
return plugin;
|
52
|
}
|
53
|
|
54
|
/**
|
55
|
* Returns an image descriptor for the image file at the given
|
56
|
* plug-in relative path
|
57
|
*
|
58
|
* @param path the path
|
59
|
* @return the image descriptor
|
60
|
*/
|
61
|
public static ImageDescriptor getImageDescriptor(String path) {
|
62
|
return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
63
|
}
|
64
|
}
|