p2izing the editor
[taxeditor.git] / eclipseprojects / eu.etaxonomy.taxeditor.prototype1 / src / eu / etaxonomy / taxeditor / prototype1 / Activator.java
1 package eu.etaxonomy.taxeditor.prototype1;
2
3 //import org.eclipse.core.databinding.DataBindingContext;
4 //import org.eclipse.core.databinding.beans.BeansObservables;
5 //import org.eclipse.core.databinding.observable.value.IObservableValue;
6 import org.eclipse.jface.resource.ImageDescriptor;
7 import org.eclipse.swt.graphics.Image;
8 import org.eclipse.ui.plugin.AbstractUIPlugin;
9 import org.osgi.framework.BundleContext;
10
11 import eu.etaxonomy.cdm.api.application.CdmApplicationController;
12 import eu.etaxonomy.taxeditor.prototype1.model.ObjectList;
13
14 /**
15 * The activator class controls the plug-in life cycle
16 */
17 public class Activator extends AbstractUIPlugin {
18
19 // The plug-in ID
20 public static final String PLUGIN_ID = "eu.etaxonomy.mvctest";
21
22 // The shared instance
23 private static Activator plugin;
24
25 private CdmApplicationController cdmApp = new CdmApplicationController();
26 private ObjectList taxonList = new ObjectList();
27 private ObjectList recentNamesList = new ObjectList();
28
29 /**
30 * The constructor
31 */
32 public Activator() {
33 taxonList.setObjectList(cdmApp.getNameService().getAllNames());
34 }
35
36
37 /*
38 * (non-Javadoc)
39 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
40 */
41 public void start(BundleContext context) throws Exception {
42 super.start(context);
43 plugin = this;
44 }
45
46 /*
47 * (non-Javadoc)
48 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
49 */
50 public void stop(BundleContext context) throws Exception {
51 plugin = null;
52 super.stop(context);
53 }
54
55 /**
56 * Returns the shared instance
57 *
58 * @return the shared instance
59 */
60 public static Activator getDefault() {
61 return plugin;
62 }
63
64 /**
65 * Returns an image descriptor for the image file at the given
66 * plug-in relative path
67 *
68 * @param path the path
69 * @return the image descriptor
70 */
71 public static ImageDescriptor getImageDescriptor(String path) {
72 return imageDescriptorFromPlugin(PLUGIN_ID, path);
73 }
74
75
76 public Image getImage(String key) {
77 return getImageRegistry().get(key);
78 }
79
80 /**
81 * @return the objectList
82 */
83 // public CdmApplicationController getApplicationController() {
84 // return this.cdmApp;
85 // }
86
87
88 /**
89 * @return the objectList
90 */
91 public ObjectList getTaxonList() {
92 return this.taxonList;
93 }
94
95 public ObjectList getRecentNamesList() {
96 return this.recentNamesList;
97 }
98 }