<%@ jet package="org.eclipse.emf.codegen.ecore.templates.editor" imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.*" class="PluginXML" version="$Id: plugin.xmljet,v 1.8 2004/06/15 20:12:14 marcelop 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;%>
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>

<!--
<%@ include file="../Header.jetinc"%>
-->

<plugin
    name = "%pluginName"
    id = "<%=genModel.getEditorPluginID()%>"
    version = "1.0.0"
    provider-name = "%providerName"
    class = "<%=genModel.getQualifiedEditorPluginClassName()%>$Implementation">

  <requires>
<%for (Iterator j=genModel.getEditorRequiredPlugins().iterator(); j.hasNext();) { String pluginID = (String)j.next();%>
    <import plugin="<%=pluginID%>" <%if (!pluginID.startsWith("org.eclipse.core.runtime")) {%>export="true"<%}%>/>
<%}%>
  </requires>

  <runtime>
<%if (genModel.isRuntimeJar()) {%>
    <library name="runtime/<%=genModel.getEditorPluginID()%>.jar">
<%} else {%>
    <library name="runtime/">
<%}%>
      <export name="*"/>
    </library>
  </runtime>

<%if (genModel.sameModelEditorProject()) {%>
  <% for (Iterator i = genModel.getAllGenPackagesWithClassifiers().iterator(); i.hasNext(); ) { GenPackage genPackage = (GenPackage)i.next(); %>
  <extension point="org.eclipse.emf.ecore.generated_package">
    <package
       uri = "<%=genPackage.getNSURI()%>"
       class = "<%=genPackage.getQualifiedPackageInterfaceName()%>" />
  </extension>
    <%if (genPackage.getResource() != GenResourceKind.NONE_LITERAL) {%>

  <extension point="org.eclipse.emf.ecore.extension_parser">
    <parser
       type="<%=genPackage.getPrefix().toLowerCase()%>"
       class="<%=genPackage.getQualifiedResourceFactoryClassName()%>" />
  </extension>
    <%}%>

  <%}%>
<%}%>
<%if (genModel.isRichClientPlatform()) {%>
  <extension
    point="org.eclipse.core.runtime.applications"
    id="<%=genModel.getEditorAdvisorClassName()%>Application">
    <application>
      <run
        class="<%=genModel.getQualifiedEditorAdvisorClassName()%>$Application">
      </run>
    </application>
  </extension>

   <extension
    point="org.eclipse.ui.perspectives">
    <perspective
      name="%_UI_Perspective_label"
      class="<%=genModel.getQualifiedEditorAdvisorClassName()%>$Perspective"
      id="<%=genModel.getQualifiedEditorAdvisorClassName()%>Perspective">
    </perspective>
  </extension>

  <extension
    point="org.eclipse.ui.actionSets">
    <actionSet
      label="%_UI_<%=genModel.getEditorAdvisorClassName()%>_ActionSet_label"
      visible="true"
      id="<%=genModel.getEditorAdvisorClassName()%>ActionSet">
      <action
        label="%_UI_Menu_About_label"
        class="<%=genModel.getQualifiedEditorAdvisorClassName()%>$AboutAction"
        menubarPath="help/additions"
        id="<%=genModel.getQualifiedEditorAdvisorClassName()%>AboutAction">
      </action>
      <action
        label="%_UI_Menu_OpenURI_label"
        accelerator="Ctrl+U"
        class="<%=genModel.getQualifiedEditorAdvisorClassName()%>$OpenURIAction"
        menubarPath="file/additions"
        id="<%=genModel.getQualifiedEditorAdvisorClassName()%>OpenURIAction">
      </action>
      <action
        label="%_UI_Menu_Open_label"
        accelerator="Ctrl+O"
        class="<%=genModel.getQualifiedEditorAdvisorClassName()%>$OpenAction"
        menubarPath="file/additions"
        id="<%=genModel.getQualifiedEditorAdvisorClassName()%>OpenAction">
      </action>
    </actionSet>
  </extension>
   
<%}%>
<%for (Iterator i = genModel.getAllGenPackagesWithClassifiers().iterator(); i.hasNext(); ) { GenPackage genPackage = (GenPackage)i.next(); %>

  <%if (genModel.isRichClientPlatform()) {%>
  <extension
    point="org.eclipse.ui.actionSets">
    <actionSet
      label="%_UI_<%=genPackage.getModelWizardClassName()%>_ActionSet_label"
      visible="true"
      id="<%=genPackage.getQualifiedActionBarContributorClassName()%>ActionSet">
      <action
        label="%_UI_<%=genPackage.getModelWizardClassName()%>_label"
        class="<%=genPackage.getQualifiedActionBarContributorClassName()%>$NewAction"
        menubarPath="file/new/additions"
        id="<%=genPackage.getQualifiedActionBarContributorClassName()%>NewAction">
      </action>
    </actionSet>
  </extension>  
  <%} else {%>
  <extension
    point = "org.eclipse.ui.newWizards">
    <category
      id = "org.eclipse.emf.ecore.Wizard.category.ID"
      name="%_UI_Wizard_category">
    </category>
    <wizard
      id = "<%=genPackage.getQualifiedModelWizardClassName()%>ID"
      name = "%_UI_<%=genPackage.getModelWizardClassName()%>_label"
      class = "<%=genPackage.getQualifiedModelWizardClassName()%>"
      category = "org.eclipse.emf.ecore.Wizard.category.ID"
      icon = "icons/full/obj16/<%=genPackage.getPrefix()%>ModelFile.gif">
      <description>%_UI_<%=genPackage.getModelWizardClassName()%>_description</description>
      <selection class = "org.eclipse.core.resources.IResource" />
    </wizard>
  </extension>
  <%}%>

  <extension point = "org.eclipse.ui.editors">
    <editor
        id = "<%=genPackage.getQualifiedEditorClassName()%>ID"
        name = "%_UI_<%=genPackage.getEditorClassName()%>_label"
        icon = "icons/full/obj16/<%=genPackage.getPrefix()%>ModelFile.gif"
        extensions = "<%=genPackage.getPrefix().toLowerCase()%>"
        class = "<%=genPackage.getQualifiedEditorClassName()%>" 
        contributorClass="<%=genPackage.getQualifiedActionBarContributorClassName()%>" >
    </editor>
  </extension>    
<%}%>
</plugin>
