package floobits;

import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.BundleContext;

/**
 * The activator class controls the plug-in life cycle
 */ 
@SuppressWarnings("unused")
public class Activator extends AbstractUIPlugin {

	// The plug-in ID
	public static final String PLUGIN_ID = "floobits-plugin"; //$NON-NLS-1$

	// The shared instance
	private static Activator plugin;
	public static IWorkspace iWorkspace;
	private static Listener listener = new Listener();
	public static Activator slef;
	
	/**
	 * The constructor
	 */
	public Activator() {
		iWorkspace = ResourcesPlugin.getWorkspace();
		slef = this;
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext context) throws Exception {
		super.start(context);
		plugin = this;
	}

	/*
	 * (non-Javadoc)
	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext context) throws Exception {
		plugin = null;
		listener.stop(iWorkspace);
		iWorkspace = null;
		super.stop(context);
	}

	/**
	 * Returns the shared instance
	 *
	 * @return the shared instance
	 */
	public static Activator getDefault() {
		return plugin;
	}
	
	public static void _log(int severity, String msg, int status) {
		slef.getLog().log(new Status(severity, PLUGIN_ID, status, msg, null));
	}
}

@@ -298,55 +298,201 @@
 ime.
-Status;%0Aimport org.osgi.framework.BundleContext
+Platform;%0Aimport org.eclipse.core.runtime.Status;%0Aimport org.osgi.framework.Bundle;%0Aimport org.osgi.framework.BundleContext;%0Aimport org.osgi.framework.Version;%0A%0Aimport floobits.common.Bootstrap
 ;%0A%0A/
@@ -1013,32 +1013,248 @@
 %0A%09%09slef = this;%0A
+%09%09Bundle bundle = Platform.getBundle(%22org.nodeeclipse.ui%22);%0A%09%09Version version = bundle.getVersion();%0A%09%09Bootstrap.bootstrap(%22Eclipse%22, Integer.toString(version.getMajor()), Integer.toString(version.getMinor()), %220%22);%0A
 %09%7D%0A%0A%09/*%0A%09 * (non

Use new bootstraping code