<?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"
            descriptionImage="icons/AppEngine-64.png"
            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.IContainer"
            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>
                        <or>
                            <test property="org.python.pydev.customizations.app_engine" forcePluginActivation="true"/>
                        </or>
                     </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/ 
    -->
    
    <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>
