<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
    <extension point="org.eclipse.core.runtime.adapters">
        <factory
            class="org.nodeclipse.debug.model.BreakpointAdapterFactory"
            adaptableType="org.chromium.debug.ui.editors.JsEditor">
          <adapter type="org.eclipse.debug.ui.actions.IToggleBreakpointsTarget" /> 
        </factory>
        <factory
            class="org.nodeclipse.debug.model.BreakpointAdapterFactory"
            adaptableType="org.nodeclipse.ui.editors.NodeEditor">
          <adapter type="org.eclipse.debug.ui.actions.IToggleBreakpointsTarget" /> 
        </factory>
    </extension>

	<extension 
          point="org.eclipse.debug.core.launchConfigurationTypes"> 
        <launchConfigurationType 
            delegate="org.nodeclipse.debug.launch.LaunchConfigurationDelegate" 
            id="org.nodeclipse.debug.launch.LaunchConfigurationType" 
            modes="run, debug" 
            name="Node Application">
        </launchConfigurationType> 
        <launchConfigurationType 
            delegate="org.nodeclipse.debug.launch.LaunchConfigurationDelegate" 
            id="org.nodeclipse.debug.launch.LaunchConfigurationTypeNodeWithMonitor" 
            modes="run, debug" 
            name="Node with monitor">
        </launchConfigurationType> 
        <launchConfigurationType 
            delegate="org.nodeclipse.debug.launch.LaunchConfigurationDelegate" 
            id="org.nodeclipse.debug.launch.LaunchConfigurationTypeCoffee" 
            modes="run, debug" 
            name="Coffee">
        </launchConfigurationType> 
        <launchConfigurationType 
            delegate="org.nodeclipse.debug.launch.LaunchConfigurationDelegate" 
            id="org.nodeclipse.debug.launch.LaunchConfigurationTypeCoffeeCompile" 
            modes="run, debug" 
            name="Coffee --compile">
        </launchConfigurationType> 
        <launchConfigurationType 
            delegate="org.nodeclipse.debug.launch.LaunchConfigurationDelegate" 
            id="org.nodeclipse.debug.launch.LaunchConfigurationTypeTypescriptCompiler" 
            modes="run, debug" 
            name="Typescript Compiler">
        </launchConfigurationType> 
       
	    <launchConfigurationType
	        id="org.nodeclipse.debug.launch.LaunchType$StandaloneV8"
	        delegate="org.nodeclipse.debug.launch.StandaloneV8LaunchTypeWrapper"
	        modes="debug"
	        name="V8 debugger for node"
	        delegateName="Debug Standalone V8 JavaScript"
	        delegateDescription="JavaScript debugger for Standalone V8"
	        sourceLocatorId="org.chromium.debug.core.ChromiumSourceDirector"
	        sourcePathComputerId="org.chromium.debug.core.ChromiumSourceComputer">
	    </launchConfigurationType>
    </extension>
    <extension
          point= "org.eclipse.debug.ui.launchConfigurationTypeImages" >   
       <launchConfigurationTypeImage   
             configTypeID= "org.nodeclipse.debug.launch.LaunchConfigurationType"   
             icon= "icons/node_bottom_right_corner_run_half_size.png"   
             id= "org.nodeclipse.debug.launch.LaunchConfigurationTypeImage" >   
       </launchConfigurationTypeImage>
       <launchConfigurationTypeImage   
             configTypeID= "org.nodeclipse.debug.launch.LaunchConfigurationTypeNodeWithMonitor"   
             icon= "icons/node_with_monitor.png"   
             id= "org.nodeclipse.debug.launch.LaunchConfigurationTypeNodeWithMonitor.image" >   
       </launchConfigurationTypeImage>
       <launchConfigurationTypeImage   
             configTypeID= "org.nodeclipse.debug.launch.LaunchConfigurationTypeCoffee"   
             icon= "icons/coffee_bottom_right_corner_run_half_size.png"   
             id= "org.nodeclipse.debug.launch.LaunchConfigurationTypeCoffee.image" >   
       </launchConfigurationTypeImage>
       <launchConfigurationTypeImage   
             configTypeID= "org.nodeclipse.debug.launch.LaunchConfigurationTypeTypescriptCompiler"   
             icon= "icons/coffee_compile.png"   
             id= "org.nodeclipse.debug.launch.LaunchConfigurationTypeTypescriptCompiler.image" >   
       </launchConfigurationTypeImage>
       <!-- TODO tsc
       <launchConfigurationTypeImage   
             configTypeID= "org.nodeclipse.debug.launch.LaunchConfigurationTypeCoffeeCompile"   
             icon= "icons/coffee_compile.png"   
             id= "org.nodeclipse.debug.launch.LaunchConfigurationTypeCoffeeCompile.image" >   
       </launchConfigurationTypeImage>
       -->
          
       <launchConfigurationTypeImage   
             configTypeID= "org.nodeclipse.debug.launch.LaunchType$StandaloneV8"   
             icon= "icons/node_bottom_right_corner_run_half_size.png"   
             id= "org.nodeclipse.debug.launch.LaunchConfigurationTypeImage" >   
       </launchConfigurationTypeImage>   
    </extension>
    <!-- node run/debug -->  
    <extension   
          point= "org.eclipse.debug.ui.launchShortcuts" >   
       <shortcut   
             class= "org.nodeclipse.debug.launch.LaunchShortcut"   
             icon= "icons/node_bottom_right_corner_run_half_size.png"
             id= "org.nodeclipse.debug.launch.LaunchShortcut"   
             label= "Node Application"   
             modes= "run, debug" > <!-- , profile ?how -->  
          <configurationType
                id= "org.nodeclipse.debug.launch.LaunchConfigurationType" >
          </configurationType>   
           <contextualLaunch>   
              <enablement>   
                 <with   
                       variable= "selection" >   
                    <count   
                          value= "1" >   
                    </count>   
                    <iterate>   
                       <or>   
                          <test   
                                property= "org.eclipse.debug.ui.matchesPattern"   
                                value= "*.js" >   
                          </test>   
                          <test   
                                property= "org.eclipse.debug.ui.matchesPattern"   
                                value= "*.njs" >   
                          </test>   
                       </or>   
                    </iterate>   
                 </with>   
              </enablement>   
           </contextualLaunch>   
       </shortcut>   
   </extension>
   
   <!-- http://stackoverflow.com/questions/1437323/assigning-a-keyboard-shortcut-for-a-specific-eclipse-build-configuration -->
	<extension point="org.eclipse.ui.commands">
	    <command id="org.nodeclipse.nodejs.run"
	             categoryId="org.eclipse.debug.ui.category.run"
	             name="Run Node Application"
	             description="Run Node Application"/>
	 </extension>
	<!-- binding can be configured by user in Properties -> General -> Keys (or Ctrl+Sh+L twice) 
	http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fextension-points%2Forg_eclipse_ui_bindings.html
	M1 is the COMMAND key on MacOS X, and the CTRL key on most other platforms.
	-->
	<extension point="org.eclipse.ui.bindings">
	    <key sequence="M1+R"
	         commandId="org.nodeclipse.nodejs.run"
	         schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
	         contextId="org.eclipse.ui.contexts.window" />
	 </extension>
	 
      
   <!-- node run/debug with monitor-->
    <extension   
          point= "org.eclipse.debug.ui.launchShortcuts" >   
       <shortcut   
             class= "org.nodeclipse.debug.launch.LaunchShortcutWithMonitor"   
             icon= "icons/node_with_monitor.png"
             id= "org.nodeclipse.debug.launch.LaunchShortcutWithMonitor"   
             label= "Node with monitor"   
             modes= "run, debug" >   
          <configurationType
                id= "org.nodeclipse.debug.launch.LaunchConfigurationTypeNodeWithMonitor" >
          </configurationType>   
           <contextualLaunch>   
              <enablement>   
                 <with   
                       variable= "selection" >   
                    <count   
                          value= "1" >   
                    </count>   
                    <iterate>   
                       <or>   
                          <test   
                                property= "org.eclipse.debug.ui.matchesPattern"   
                                value= "*.js" >   
                          </test>   
                          <test   
                                property= "org.eclipse.debug.ui.matchesPattern"   
                                value= "*.coffee" >   
                          </test>   
                       </or>   
                    </iterate>
                 </with>   
              </enablement>   
           </contextualLaunch>   
       </shortcut>   
   </extension>
   <!-- coffee run/debug -->
    <extension   
          point= "org.eclipse.debug.ui.launchShortcuts" >   
       <shortcut   
             class= "org.nodeclipse.debug.launch.LaunchShortcut"   
             icon= "icons/coffee_bottom_right_corner_run_half_size.png"
             id= "org.nodeclipse.debug.launch.LaunchShortcut"   
             label= "coffee"   
             modes= "run, debug" >   
          <configurationType
                id= "org.nodeclipse.debug.launch.LaunchConfigurationTypeCoffee" >
          </configurationType>   
           <contextualLaunch>   
              <enablement>   
                 <with   
                       variable= "selection" >   
                    <count   
                          value= "1" >   
                    </count>   
                    <iterate>
                       <or>   
                          <test   
                                property= "org.eclipse.debug.ui.matchesPattern"   
                                value= "*.coffee" >   
                          </test>   
                          <test   
                                property= "org.eclipse.debug.ui.matchesPattern"   
                                value= "*.litcoffee" >   
                          </test>   
                          <test   
                                property= "org.eclipse.debug.ui.matchesPattern"   
                                value= "*.coffee.md" >   
                          </test>   
                       </or> 
                      </iterate>
                 </with>   
              </enablement>   
           </contextualLaunch>   
       </shortcut>   
   </extension>
   <!-- coffee -c (compile) -->
    <extension   
          point= "org.eclipse.debug.ui.launchShortcuts" >   
       <shortcut   
             class= "org.nodeclipse.debug.launch.LaunchShortcutCoffeeCompile"   
             icon= "icons/coffee_compile.png"
             id= "org.nodeclipse.debug.launch.LaunchShortcutCoffeeCompile"   
             label= "coffee --compile"   
             modes= "run, debug" >   
          <configurationType
                id= "org.nodeclipse.debug.launch.LaunchConfigurationTypeCoffeeCompile" >
          </configurationType>   
           <contextualLaunch>   
              <enablement>   
                 <with   
                       variable= "selection" >   
                    <count   
                          value= "1" >   
                    </count>   
                    <iterate>
                       <or>   
                          <test   
                                property= "org.eclipse.debug.ui.matchesPattern"   
                                value= "*.coffee" >   
                          </test>   
                          <test   
                                property= "org.eclipse.debug.ui.matchesPattern"   
                                value= "*.litcoffee" >   
                          </test>   
                          <test   
                                property= "org.eclipse.debug.ui.matchesPattern"   
                                value= "*.coffee.md" >   
                          </test>   
                       </or> 
                      </iterate>
                 </with>   
              </enablement>   
           </contextualLaunch>   
       </shortcut>   
   </extension>
   <!-- typescript compiler -->
    <extension   
          point= "org.eclipse.debug.ui.launchShortcuts" >   
       <shortcut   
             class= "org.nodeclipse.debug.launch.LaunchShortcutTypescriptCompiler"   
             icon= "icons/coffee.png"
             id= "org.nodeclipse.debug.launch.LaunchShortcutTypescriptCompiler"   
             label= "tsc"   
             modes= "run, debug" >   
          <configurationType
                id= "org.nodeclipse.debug.launch.LaunchConfigurationTypeTypescriptCompiler" >
          </configurationType>   
           <contextualLaunch>   
              <enablement>   
                 <with   
                       variable= "selection" >   
                    <count   
                          value= "1" >   
                    </count>   
                    <iterate>
                       <or>   
                          <test   
                                property= "org.eclipse.debug.ui.matchesPattern"   
                                value= "*.ts" >   
                          </test>   
                        </or> 
                      </iterate>
                 </with>   
              </enablement>   
           </contextualLaunch>   
       </shortcut>   
   </extension>
   <extension
        point="org.eclipse.debug.ui.launchConfigurationTabGroups">
        <launchConfigurationTabGroup   
       		class= "org.nodeclipse.debug.launch.LaunchConfigurationTabGroup"   
      		id= "org.nodeclipse.debug.launch.LaunchConfigurationTabGroup"   
        	type= "org.nodeclipse.debug.launch.LaunchConfigurationType" >   
		</launchConfigurationTabGroup>
	    <launchConfigurationTabGroup
	        type="org.nodeclipse.debug.launch.LaunchType$StandaloneV8"
	        class="org.chromium.debug.ui.launcher.LaunchTabGroup$StandaloneV8"
	        id="org.nodeclipse.debug.launch.LaunchType$StandaloneV8TabGroup">
	    </launchConfigurationTabGroup>
   </extension>
</plugin>
