// Path: core/fr.opensagres.eclipse.jsbuild.core/src/fr/opensagres/eclipse/jsbuild/core/IJSBuildFileNode.java
// public interface IJSBuildFileNode {
// 
// 	/**
// 	 * Returns the node name.
// 	 * 
// 	 * @return the node name.
// 	 */
// 	String getName();
// 
// 	/**
// 	 * Returns the label of the task.
// 	 * 
// 	 * @return the label of the task.
// 	 */
// 	String getLabel();
// 
// 	/**
// 	 * Returns true if the node have children and false otherwise.
// 	 * 
// 	 * @return true if the node have children and false otherwise.
// 	 */
// 	boolean hasChildren();
// 
// 	/**
// 	 * Returns the parent node.
// 	 * 
// 	 * @return the parent node.
// 	 */
// 	IJSBuildFileNode getParentNode();
// 
// 	/**
// 	 * Returns the tasks children.
// 	 * 
// 	 * @return the tasks children.
// 	 * @throws CoreException
// 	 */
// 	Collection<ITask> getChildNodes();
// 
// 	/**
// 	 * Returns the owner build file.
// 	 * 
// 	 * @return the owner build file.
// 	 */
// 	IJSBuildFile getBuildFile();
// 
// 	/**
// 	 * Returns the factory id {@link IJSBuildFileFactory} which have created
// 	 * this instance.
// 	 * 
// 	 * @return the factory id {@link IJSBuildFileFactory} which have created
// 	 *         this instance.
// 	 */
// 	String getFactoryId();
// 
// 	/**
// 	 * Returns the location of the node and null otherwise.
// 	 * @param document 
// 	 * 
// 	 * @return the location of the node and null otherwise.
// 	 */
// 	Location getLocation(String text);
// }


import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdapterFactory;
import fr.opensagres.eclipse.jsbuild.core.IJSBuildFileNode;

/**
 *  Copyright (c) 2013-2014 Angelo ZERR.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *  Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
 */
package fr.opensagres.eclipse.jsbuild.internal.ui;



public class JSBuildFileAdapterFactory implements IAdapterFactory {

	private static Class[] PROPERTIES = new Class[] { IResource.class };

	@Override
	public Object getAdapter(Object element, Class key) {

// Path: core/fr.opensagres.eclipse.jsbuild.core/src/fr/opensagres/eclipse/jsbuild/core/IJSBuildFileNode.java
// public interface IJSBuildFileNode {
// 
// 	/**
// 	 * Returns the node name.
// 	 * 
// 	 * @return the node name.
// 	 */
// 	String getName();
// 
// 	/**
// 	 * Returns the label of the task.
// 	 * 
// 	 * @return the label of the task.
// 	 */
// 	String getLabel();
// 
// 	/**
// 	 * Returns true if the node have children and false otherwise.
// 	 * 
// 	 * @return true if the node have children and false otherwise.
// 	 */
// 	boolean hasChildren();
// 
// 	/**
// 	 * Returns the parent node.
// 	 * 
// 	 * @return the parent node.
// 	 */
// 	IJSBuildFileNode getParentNode();
// 
// 	/**
// 	 * Returns the tasks children.
// 	 * 
// 	 * @return the tasks children.
// 	 * @throws CoreException
// 	 */
// 	Collection<ITask> getChildNodes();
// 
// 	/**
// 	 * Returns the owner build file.
// 	 * 
// 	 * @return the owner build file.
// 	 */
// 	IJSBuildFile getBuildFile();
// 
// 	/**
// 	 * Returns the factory id {@link IJSBuildFileFactory} which have created
// 	 * this instance.
// 	 * 
// 	 * @return the factory id {@link IJSBuildFileFactory} which have created
// 	 *         this instance.
// 	 */
// 	String getFactoryId();
// 
// 	/**
// 	 * Returns the location of the node and null otherwise.
// 	 * @param document 
// 	 * 
// 	 * @return the location of the node and null otherwise.
// 	 */
// 	Location getLocation(String text);
// }


// Path: core/fr.opensagres.eclipse.jsbuild.ui/src/fr/opensagres/eclipse/jsbuild/internal/ui/JSBuildFileAdapterFactory.java
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdapterFactory;
import fr.opensagres.eclipse.jsbuild.core.IJSBuildFileNode;

/**
 *  Copyright (c) 2013-2014 Angelo ZERR.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *  Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
 */
package fr.opensagres.eclipse.jsbuild.internal.ui;



public class JSBuildFileAdapterFactory implements IAdapterFactory {

	private static Class[] PROPERTIES = new Class[] { IResource.class };

	@Override
	public Object getAdapter(Object element, Class key) {

		IJSBuildFileNode node = getJSBuildFileNode(element);
