<%@ jet package="org.eclipse.emf.codegen.ecore.templates.edit" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="Plugin" version="$Id: Plugin.javajet,v 1.4 2004/06/08 18:20:10 emerks Exp $" %>
<%
/**
 * <copyright>
 *
 * Copyright (c) 2002-2004 IBM Corporation and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 *
 * Contributors:
 *   IBM - Initial API and implementation
 *
 * </copyright>
 */
%>
<%GenModel genModel = (GenModel)argument;%>
<%@ include file="../Header.jetinc"%>
package <%=genModel.getEditPluginPackageName()%>;

<%genModel.addImport("org.eclipse.emf.common.EMFPlugin");%>
<%genModel.addImport("org.eclipse.emf.common.util.ResourceLocator");%>
<%genModel.markImportLocation(stringBuffer);%>

/**
 * This is the central singleton for the <%=genModel.getModelName()%> edit plugin.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public final class <%=genModel.getEditPluginClassName()%> extends EMFPlugin
{
<%if (genModel.getCopyrightText() != null) {%>
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static final <%=genModel.getImportedName("java.lang.String")%> copyright = "<%=genModel.getCopyrightText()%>";<%=genModel.getNonNLS()%>

<%}%>
	/**
	 * Keep track of the singleton.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static final <%=genModel.getEditPluginClassName()%> INSTANCE = new <%=genModel.getEditPluginClassName()%>();

	/**
	 * Keep track of the singleton.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static Implementation plugin;

	/**
	 * Create the instance.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public <%=genModel.getEditPluginClassName()%>()
	{
		super
		  (new ResourceLocator [] 
		   {
<%for (Iterator i = genModel.getEditResourceDelegateImportedPluginClassNames().iterator(); i.hasNext(); ) { String pluginClassName = (String)i.next(); %>
		     <%=pluginClassName%>.INSTANCE,
<%}%>
		   });
	}

	/**
	 * Returns the singleton instance of the Eclipse plugin.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the singleton instance.
	 * @generated
	 */
	public ResourceLocator getPluginResourceLocator()
	{
		return plugin;
	}

	/**
	 * Returns the singleton instance of the Eclipse plugin.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the singleton instance.
	 * @generated
	 */
	public static Implementation getPlugin()
	{
		return plugin;
	}

	/**
	 * The actual implementation of the Eclipse <b>Plugin</b>.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static class Implementation extends EclipsePlugin
	{
		/**
		 * Creates an instance.
		 * <!-- begin-user-doc -->
		 * <!-- end-user-doc -->
<%if (genModel.needsRuntimeCompatibility()) {%>
		 * @param descriptor the description of the plugin.
<%}%>
		 * @generated
		 */
		public Implementation(<%if (genModel.needsRuntimeCompatibility()) {%><%=genModel.getImportedName("org.eclipse.core.runtime.IPluginDescriptor")%> descriptor<%}%>)
		{
			super(<%if (genModel.needsRuntimeCompatibility()) {%>descriptor<%}%>);

			// Remember the static instance.
			//
			plugin = this;
		}
	}

}
<%genModel.emitSortedImports();%>
