package org.jetbrains.kotlin.core;

import static org.eclipse.core.resources.ResourcesPlugin.getWorkspace;

import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.jetbrains.kotlin.core.builder.ResourceChangeListener;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

public class Activator implements BundleActivator {
	private static BundleContext context;
	
	private final IResourceChangeListener resourceChangeListener = new ResourceChangeListener();

	public static final String PLUGIN_ID = "org.jetbrains.kotlin.core";
	
	static BundleContext getContext() {
		return context;
	}

	@Override
    public void start(BundleContext bundleContext) throws Exception {
		Activator.context = bundleContext;
		
		getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);
	}

	@Override
    public void stop(BundleContext bundleContext) throws Exception {
		Activator.context = null;
		
		getWorkspace().removeResourceChangeListener(resourceChangeListener);
	}
}

@@ -208,32 +208,72 @@
 ChangeListener;%0A
+import org.eclipse.core.runtime.Plugin;%0A
 import org.jetbr
@@ -325,51 +325,8 @@
 er;%0A
-import org.osgi.framework.BundleActivator;%0A
 impo
@@ -390,74 +390,62 @@
 tor 
-implements BundleActivator %7B%0A%09private static BundleContext context
+extends Plugin %7B%0A    %0A%09private static Activator plugin
 ;%0A%09%0A
@@ -612,41 +612,90 @@
 e%22;%0A
-%09%0A%09static BundleContext getContex
+%0A%09public Activator() %7B%0A%09    plugin = this;%0A%09%7D%0A%09%0A%09public static Activator getDefaul
 t() 
@@ -705,23 +705,22 @@
 %09return 
-context
+plugin
 ;%0A%09%7D%0A%0A%09@
@@ -802,48 +802,8 @@
 n %7B%0A
-%09%09Activator.context = bundleContext;%0A%09%09%0A
 %09%09ge
@@ -900,16 +900,49 @@
 HANGE);%0A
+%09%09%0A%09%09super.start(bundleContext);%0A
 %09%7D%0A%0A%09@Ov
@@ -1021,39 +1021,8 @@
 n %7B%0A
-%09%09Activator.context = null;%0A%09%09%0A
 %09%09ge
@@ -1088,13 +1088,33 @@
 tener);%0A
+%09%09%0A%09%09plugin = null;%0A
 %09%7D%0A%7D%0A

Make core activator extendable of Plugin class