// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtPlugin.java
// public class SbtPlugin extends AbstractUIPlugin {
// 
// 	public static final String[] PROJECT_NATURES_IDS = new String[] { 
// 		ScalaPlugin.plugin().natureId(), 
// 		"org.eclipse.jdt.core.javanature",
// 		SbtPlugin.NATURE_ID 
// 	};
// 
// 	/** The plug-in ID */
// 	public static final String PLUGIN_ID = "com.github.jarlakxen.scala.sbt"; //$NON-NLS-1$
// 
// 	/** The nature ID */
// 	public static final String NATURE_ID = PLUGIN_ID + ".SbtProjectNature"; //$NON-NLS-1$
// 
// 	// The shared instance
// 	private static SbtPlugin plugin;
// 
// 	public static final String ICON_SETTING_KEY = "/icons/setting_key.gif";
// 	public static final String ICON_SETTING_VALUE = "/icons/setting_value.gif";
// 
// 	/**
// 	 * The constructor
// 	 */
// 	public SbtPlugin() {
// 	}
// 
// 	/*
// 	 * (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;
// 		SbtProjectFilesChangeListener.register();
// 		SbtLaunchJarManager.deploy();
// 	}
// 
// 	/*
// 	 * (non-Javadoc)
// 	 * 
// 	 * @see
// 	 * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
// 	 * )
// 	 */
// 	public void stop(BundleContext context) throws Exception {
// 		SbtLaunchJarManager.undeploy();
// 		plugin = null;
// 		super.stop(context);
// 	}
// 
// 	protected void initializeImageRegistry(ImageRegistry registory) {
// 		super.initializeImageRegistry(registory);
// 		registory.put(ICON_SETTING_KEY, ImageDescriptor.createFromURL(getBundle().getEntry(ICON_SETTING_KEY)));
// 		registory.put(ICON_SETTING_VALUE, ImageDescriptor.createFromURL(getBundle().getEntry(ICON_SETTING_VALUE)));
// 	}
// 
// 	/**
// 	 * Returns the shared instance
// 	 * 
// 	 * @return the shared instance
// 	 */
// 	public static SbtPlugin getDefault() {
// 		return plugin;
// 	}
// 
// 	public static void logException(Exception ex) {
// 		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, ex.toString(), ex);
// 		getDefault().getLog().log(status);
// 	}
// 
// 	public static void addProjectNatures(IProject project) throws CoreException {
// 		IProjectDescription desc = project.getDescription();
// 		desc.setNatureIds(PROJECT_NATURES_IDS);
// 		project.setDescription(desc, null);
// 	}
// }


import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.action.IAction;
import com.github.jarlakxen.scala.sbt.SbtPlugin;

package com.github.jarlakxen.scala.sbt.action;



/**
 * Updates project dependency.
 *
 * @author Facundo Viale
 */
public class DownloadSourceAction extends AbstractSbtCommandAction {

	public DownloadSourceAction() {
		super("'eclipse with-source=true'");
	}

	@Override
	public void run(IAction action) {
		super.run(action);
		try {
			project.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);

// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/SbtPlugin.java
// public class SbtPlugin extends AbstractUIPlugin {
// 
// 	public static final String[] PROJECT_NATURES_IDS = new String[] { 
// 		ScalaPlugin.plugin().natureId(), 
// 		"org.eclipse.jdt.core.javanature",
// 		SbtPlugin.NATURE_ID 
// 	};
// 
// 	/** The plug-in ID */
// 	public static final String PLUGIN_ID = "com.github.jarlakxen.scala.sbt"; //$NON-NLS-1$
// 
// 	/** The nature ID */
// 	public static final String NATURE_ID = PLUGIN_ID + ".SbtProjectNature"; //$NON-NLS-1$
// 
// 	// The shared instance
// 	private static SbtPlugin plugin;
// 
// 	public static final String ICON_SETTING_KEY = "/icons/setting_key.gif";
// 	public static final String ICON_SETTING_VALUE = "/icons/setting_value.gif";
// 
// 	/**
// 	 * The constructor
// 	 */
// 	public SbtPlugin() {
// 	}
// 
// 	/*
// 	 * (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;
// 		SbtProjectFilesChangeListener.register();
// 		SbtLaunchJarManager.deploy();
// 	}
// 
// 	/*
// 	 * (non-Javadoc)
// 	 * 
// 	 * @see
// 	 * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
// 	 * )
// 	 */
// 	public void stop(BundleContext context) throws Exception {
// 		SbtLaunchJarManager.undeploy();
// 		plugin = null;
// 		super.stop(context);
// 	}
// 
// 	protected void initializeImageRegistry(ImageRegistry registory) {
// 		super.initializeImageRegistry(registory);
// 		registory.put(ICON_SETTING_KEY, ImageDescriptor.createFromURL(getBundle().getEntry(ICON_SETTING_KEY)));
// 		registory.put(ICON_SETTING_VALUE, ImageDescriptor.createFromURL(getBundle().getEntry(ICON_SETTING_VALUE)));
// 	}
// 
// 	/**
// 	 * Returns the shared instance
// 	 * 
// 	 * @return the shared instance
// 	 */
// 	public static SbtPlugin getDefault() {
// 		return plugin;
// 	}
// 
// 	public static void logException(Exception ex) {
// 		IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, ex.toString(), ex);
// 		getDefault().getLog().log(status);
// 	}
// 
// 	public static void addProjectNatures(IProject project) throws CoreException {
// 		IProjectDescription desc = project.getDescription();
// 		desc.setNatureIds(PROJECT_NATURES_IDS);
// 		project.setDescription(desc, null);
// 	}
// }


// Path: com.github.jarlakxen.scala.sbt/src/com/github/jarlakxen/scala/sbt/action/DownloadSourceAction.java
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.action.IAction;
import com.github.jarlakxen.scala.sbt.SbtPlugin;

package com.github.jarlakxen.scala.sbt.action;



/**
 * Updates project dependency.
 *
 * @author Facundo Viale
 */
public class DownloadSourceAction extends AbstractSbtCommandAction {

	public DownloadSourceAction() {
		super("'eclipse with-source=true'");
	}

	@Override
	public void run(IAction action) {
		super.run(action);
		try {
			project.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);

			SbtPlugin.addProjectNatures(project);
