// Path: org.clonedigger/src/org/clonedigger/Activator.java
// public class Activator extends AbstractUIPlugin {
// 
// 	// The plug-in ID
// 	public static final String PLUGIN_ID = "org.clonedigger";
// 
// 	// The shared instance
// 	private static Activator plugin;
// 	
// 	public Activator() {
// 	}
// 
// 	/*
// 	 * (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;
// 		super.stop(context);
// 	}
// 
// 	/**
// 	 * Returns the shared instance
// 	 *
// 	 * @return the shared instance
// 	 */
// 	public static Activator getDefault() {
// 		return plugin;
// 	}
// 	
// 	public static void log(Throwable e) {
// 		try {
// 	        Status s = new Status(IStatus.ERROR, PLUGIN_ID, 
// 	        		e.getMessage() != null ? e.getMessage() : "No message gotten.", e);
// 	        getDefault().getLog().log(s);
//         } catch (Throwable e1) {
//             //logging should never fail!
//         }
//     }
// 
// 	/**
// 	 * Returns an image descriptor for the image file at the given
// 	 * plug-in relative path
// 	 *
// 	 * @param path the path
// 	 * @return the image descriptor
// 	 */
// 	public static ImageDescriptor getImageDescriptor(String path) {
// 		return imageDescriptorFromPlugin(PLUGIN_ID, path);
// 	}
// }


import java.io.File;
import java.io.IOException;
import org.clonedigger.Activator;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.osgi.framework.Bundle;

		}
		if (!(f.delete())) {
		    throw new java.io.IOException("cannot delete "+f.getPath());
		}
    }
	
	/**
	 * The action has been activated. The argument of the
	 * method represents the 'real' action sitting
	 * in the workbench UI.
	 * @see IWorkbenchWindowActionDelegate#run
	 */
	public void run(IAction action) 
	{
		Bundle bundle = Platform.getBundle("org.clonedigger");
		String runpath = "";
		try {
			runpath = FileLocator.toFileURL(bundle.getEntry("runclonedigger.py")).getPath();
			if(WINDOWS) runpath = runpath.replaceAll("^/+", "");

			String ppath = (new File(runpath)).getParent() + "/CloneDigger";

			delrec(new File(ppath));

			MessageDialog.openInformation(
					null,
					"CloneDigger Plug-in",
					"CloneDigger will be automatically updated during the next run."
			);
		} catch (IOException e) {

// Path: org.clonedigger/src/org/clonedigger/Activator.java
// public class Activator extends AbstractUIPlugin {
// 
// 	// The plug-in ID
// 	public static final String PLUGIN_ID = "org.clonedigger";
// 
// 	// The shared instance
// 	private static Activator plugin;
// 	
// 	public Activator() {
// 	}
// 
// 	/*
// 	 * (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;
// 		super.stop(context);
// 	}
// 
// 	/**
// 	 * Returns the shared instance
// 	 *
// 	 * @return the shared instance
// 	 */
// 	public static Activator getDefault() {
// 		return plugin;
// 	}
// 	
// 	public static void log(Throwable e) {
// 		try {
// 	        Status s = new Status(IStatus.ERROR, PLUGIN_ID, 
// 	        		e.getMessage() != null ? e.getMessage() : "No message gotten.", e);
// 	        getDefault().getLog().log(s);
//         } catch (Throwable e1) {
//             //logging should never fail!
//         }
//     }
// 
// 	/**
// 	 * Returns an image descriptor for the image file at the given
// 	 * plug-in relative path
// 	 *
// 	 * @param path the path
// 	 * @return the image descriptor
// 	 */
// 	public static ImageDescriptor getImageDescriptor(String path) {
// 		return imageDescriptorFromPlugin(PLUGIN_ID, path);
// 	}
// }


// Path: org.clonedigger/src/org/clonedigger/actions/UpdateAction.java
import java.io.File;
import java.io.IOException;
import org.clonedigger.Activator;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.osgi.framework.Bundle;

		}
		if (!(f.delete())) {
		    throw new java.io.IOException("cannot delete "+f.getPath());
		}
    }
	
	/**
	 * The action has been activated. The argument of the
	 * method represents the 'real' action sitting
	 * in the workbench UI.
	 * @see IWorkbenchWindowActionDelegate#run
	 */
	public void run(IAction action) 
	{
		Bundle bundle = Platform.getBundle("org.clonedigger");
		String runpath = "";
		try {
			runpath = FileLocator.toFileURL(bundle.getEntry("runclonedigger.py")).getPath();
			if(WINDOWS) runpath = runpath.replaceAll("^/+", "");

			String ppath = (new File(runpath)).getParent() + "/CloneDigger";

			delrec(new File(ppath));

			MessageDialog.openInformation(
					null,
					"CloneDigger Plug-in",
					"CloneDigger will be automatically updated during the next run."
			);
		} catch (IOException e) {

			Activator.log(e);
