<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<!-- wizards -->
   <extension point="org.eclipse.ui.newWizards">

      <wizard
            canFinishEarly="false"
            category="org.python.pydev.PythonCategory"
            class="org.python.pydev.customizations.app_engine.wizards.AppEngineWizard"
            finalPerspective="org.python.pydev.ui.PythonPerspective"
            hasPages="true"
            icon="icons/AppEngine-16.png"
            id="org.python.pydev.customizations.app_engine.wizards.AppEngineWizard"
            name="PyDev Google App Engine Project"
            preferredPerspectives="org.python.pydev.ui.PythonPerspective"
            project="true"/>
    </extension>


    <extension point="org.eclipse.debug.core.launchConfigurationTypes">
        <launchConfigurationType
            delegate="org.python.pydev.customizations.app_engine.launching.AppEngineLaunchConfigurationDelegate"
            id="org.python.pydev.customizations.app_engine.launching.AppEngineLaunchConfigurationType"
            modes="run, debug"
            name="PyDev Google App Run"
            public="true">
        </launchConfigurationType>
    </extension>

    <extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
        <launchConfigurationTypeImage
            icon="icons/AppEngine-16.png"
            configTypeID="org.python.pydev.customizations.app_engine.launching.AppEngineLaunchConfigurationType"
            id="org.python.pydev.customizations.app_engine.launching.AppEngineLaunchConfigurationTypeImage">
        </launchConfigurationTypeImage>
    </extension>

   <extension point="org.eclipse.core.expressions.propertyTesters">
      <propertyTester
            namespace="org.python.pydev.customizations"
            properties="app_engine"
            type="org.python.pydev.navigator.elements.IWrappedResource"
            class="org.python.pydev.customizations.app_engine.launching.AppEnginePropertyTester"
            id="org.python.pydev.navigator.elements.IWrappedResource.app_engine_wrapped_resource">
      </propertyTester>
      <propertyTester
            namespace="org.python.pydev.customizations"
            properties="app_engine"
            type="org.eclipse.core.resources.IResource"
            class="org.python.pydev.customizations.app_engine.launching.AppEnginePropertyTester"
            id="org.python.pydev.navigator.elements.IWrappedResource.app_engine_container">
      </propertyTester>
   </extension>

    <extension point="org.eclipse.debug.ui.launchShortcuts">
        <shortcut
            label="PyDev: Google App Run"
            icon="icons/AppEngine-16.png"
            modes="run, debug"
            class="org.python.pydev.customizations.app_engine.launching.AppEngineLaunchShortcut"
            id="org.python.pydev.customizations.app_engine.launching.AppEngineLaunchShortcut">
            <!--this adds it to run-as...-->
            <contextualLaunch>
               <enablement>
                  <with variable="selection">
                     <count value="1"/>
                     <iterate>
                        <and>
                            <adapt type="org.eclipse.core.resources.IContainer" />
                            <instanceof value="org.python.pydev.navigator.elements.IWrappedResource"/>
                            <test property="org.eclipse.debug.ui.projectNature" value="org.python.pydev.pythonNature"/>
                            <test property="org.python.pydev.customizations.app_engine" forcePluginActivation="true"/>
                        </and>
                     </iterate>
                  </with>
               </enablement>
            </contextualLaunch>
            <configurationType id="org.python.pydev.customizations.app_engine.launching.AppEngineLaunchConfigurationType"/>
        </shortcut>
    </extension>

    <extension point="org.eclipse.debug.ui.launchConfigurationTabGroups">
        <!-- Note that it's the same as the regular python launch! -->
        <launchConfigurationTabGroup
            type="org.python.pydev.customizations.app_engine.launching.AppEngineLaunchConfigurationType"
            class="org.python.pydev.debug.ui.PythonTabGroup"
            id="org.python.pydev.customizations.app_engine.launching.AppEngineTabGroup">
        </launchConfigurationTabGroup>
    </extension>


    <!--
    Reference for creating the commands:
    http://xpomul.bloggles.info/2008/08/12/advanced-features-in-eclipse-popup-menus-take-2-the-new-api/

    I take it back. it doesn't work in eclipse 3.2, so, changed to use reference:
    http://xpomul.bloggles.info/2008/07/24/using-advanced-features-in-eclipse-popup-menus/
    -->
    <extension point="org.eclipse.ui.popupMenus">

      <objectContribution
            adaptable="false"
            id="org.python.pydev.customizations.app_engine.actions.AppEngineUploadAction"
            objectClass="org.python.pydev.navigator.elements.PythonSourceFolder">
         <menu
               icon="icons/AppEngine-16.png"
               id="org.python.pydev.ui.actions.app_engine_menu"
               label="PyDev: Google App Engine"/>
         <action
               class="org.python.pydev.customizations.app_engine.actions.AppEngineUploadAction"
               enablesFor="1"
               id="org.python.pydev.customizations.app_engine.actions.AppEngineUploadAction"
               label="Upload"
               menubarPath="org.python.pydev.ui.actions.app_engine_menu/app_engine"
               tooltip="Upload google app engine.">
         </action>
         <visibility><objectState name="app_engine" value="true"></objectState></visibility>
      </objectContribution>


      <objectContribution
            adaptable="false"
            id="org.python.pydev.customizations.app_engine.actions.AppEngineManageAction"
            objectClass="org.python.pydev.navigator.elements.PythonSourceFolder">
         <action
               class="org.python.pydev.customizations.app_engine.actions.AppEngineManageAction"
               enablesFor="1"
               id="org.python.pydev.customizations.app_engine.actions.AppEngineManageAction"
               label="Manage"
               menubarPath="org.python.pydev.ui.actions.app_engine_menu/app_engine"
               tooltip="Manage google app engine.">
         </action>
         <visibility><objectState name="app_engine" value="true"></objectState></visibility>
      </objectContribution>

    </extension>




    <!--
    Commented out because eclipse 3.2 doesn't support it
    Maybe in the future, when support for eclipse 3.2 is removed, this could be re-added
    (and the hack for PythonSourceFolderActionFilter removed).

    <extension point="org.eclipse.ui.commands">
      <command
            description="Manage project"
            id="org.python.pydev.customizations.app_engine.actions.AppEngineManage"
            name="Manage project">
      </command>
    </extension>


    <extension point="org.eclipse.ui.handlers">
      <handler
            class="org.python.pydev.customizations.app_engine.actions.AppEngineManage"
            commandId="org.python.pydev.customizations.app_engine.actions.AppEngineManage">
         <enabledWhen>
            <with variable="selection">
               <iterate
                     ifEmpty="false"
                     operator="and">
                  <test property="org.python.pydev.customizations.app_engine" forcePluginActivation="true"/>
               </iterate>
            </with>
         </enabledWhen>
      </handler>
    </extension>

    <extension point="org.eclipse.ui.commands">
      <command
            description="Upload project"
            id="org.python.pydev.customizations.app_engine.actions.AppEngineUpload"
            name="Upload project">
      </command>
    </extension>


    <extension point="org.eclipse.ui.handlers">
      <handler
            class="org.python.pydev.customizations.app_engine.actions.AppEngineUpload"
            commandId="org.python.pydev.customizations.app_engine.actions.AppEngineUpload">
         <enabledWhen>
            <with variable="selection">
               <iterate
                     ifEmpty="false"
                     operator="and">
                  <test property="org.python.pydev.customizations.app_engine" forcePluginActivation="true"/>
               </iterate>
            </with>
         </enabledWhen>
      </handler>
    </extension>


    <extension point="org.eclipse.ui.menus">
        <menuContribution locationURI="popup:org.eclipse.ui.popup.any?after=additions">
            <menu
            icon="icons/AppEngine-16.png"
            id="org.python.pydev.customizations.app_engine"
            label="PyDev: Google App Engine">


                <command
                    commandId="org.python.pydev.customizations.app_engine.actions.AppEngineManage"
                    style="push">
                    <visibleWhen>
                        <with variable="selection">
                            <iterate
                                ifEmpty="false"
                                operator="and">
                               <test property="org.python.pydev.customizations.app_engine" forcePluginActivation="true"/>
                            </iterate>
                        </with>
                    </visibleWhen>
                </command>


                <command
                    commandId="org.python.pydev.customizations.app_engine.actions.AppEngineUpload"
                    style="push">
                    <visibleWhen>
                        <with variable="selection">
                            <iterate
                                ifEmpty="false"
                                operator="and">
                               <test property="org.python.pydev.customizations.app_engine" forcePluginActivation="true"/>
                            </iterate>
                        </with>
                    </visibleWhen>
                </command>


            </menu>
        </menuContribution>
    </extension>
    -->

</plugin>
