]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/winterwell.markdown/src/winterwell/markdown/Activator.java
Tycho compilation changes for SVN version also.
[simantics/platform.git] / bundles / winterwell.markdown / src / winterwell / markdown / Activator.java
1 package winterwell.markdown;
2
3 import org.eclipse.ui.plugin.AbstractUIPlugin;
4 import org.osgi.framework.BundleContext;
5
6 import winterwell.markdown.preferences.MarkdownPreferencePage;
7
8 /**
9  * The activator class controls the plug-in life cycle
10  */
11 public class Activator extends AbstractUIPlugin {
12
13         // The plug-in ID
14         public static final String PLUGIN_ID = "winterwell.markdown";
15
16         // The shared instance
17         private static Activator plugin;
18         
19         /**
20          * The constructor
21          */
22         public Activator() {
23         }
24
25         /*
26          * (non-Javadoc)
27          * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
28          */
29         public void start(BundleContext context) throws Exception {
30                 super.start(context);
31                 plugin = this;
32                 doInstall();
33                 MarkdownPreferencePage.setDefaultPreferences(getPreferenceStore());
34         }
35
36         // ?? Have this method called by start(), saving a reminder so it doesn't repeat itself?? 
37         private void doInstall() {
38                 // ??Try to make this the default for file types -- but is this possible??
39                 // c.f. http://stackoverflow.com/questions/15877123/eclipse-rcp-programmatically-associate-file-type-with-editor
40         }
41
42         /*
43          * (non-Javadoc)
44          * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
45          */
46         public void stop(BundleContext context) throws Exception {
47                 plugin = null;
48                 super.stop(context);
49         }
50
51         /**
52          * Returns the shared instance
53          *
54          * @return the shared instance
55          */
56         public static Activator getDefault() {
57                 return plugin;
58         }
59
60 }