How to use "org.eclipse.debug.ui.launchShortcuts"?

I wrote a custom launcher in Eclipse, which I can access using the Run As and Debug As options in the toolbar. I also want to be able to run through the package explorer and by right-clicking on the file editor to run. I added a tutorial here to add a shortcut, but nothing happens, it does not enter my processing code and does not complain about the dot extension setting.

Here is a snippet from my plugin.xml

 <extension point="org.eclipse.debug.ui.launchShortcuts"> <shortcut id = "org.mylauncher.launchCalcShortcut" class = "org.mylauncher.LaunchCalcShortcut" description="Execute calculations" icon="icons/launch_16_16.png" label="Calculate" modes="run, debug" > <configurationType id="org.mylauncher.launchCalc"/> </shortcut> 

I also played with the removal of the (optional) icon of the icon and separately checked the icon path.

I change this configuration for several hours without a good result, and it is impossible to debug, because it does not work at all in my own code.

Thanks.

+4
source share
1 answer

It seems that the correct answer to this problem is to specify a context start. Here is my working configuration:

  <extension point="org.eclipse.debug.ui.launchShortcuts"> <shortcut class="com.xxxx.CalcLaunchShortcut" icon="calc.png" id="com.xxxx.CalcLaunchShortcut" label="Calc" modes="run, debug"> <contextualLaunch> <contextLabel mode="run" label="Run Calculator" /> <contextLabel mode="debug" label="Debug Calculator" /> <enablement > <with variable="selection"> <count value="1"/> <iterate> <adapt type="org.eclipse.core.resources.IResource"> <and> <test property="org.eclipse.core.resources.name" value="*.calc"/> </and> </adapt> </iterate> </with> </enablement> </contextualLaunch> </shortcut> 

+4
source

Source: https://habr.com/ru/post/1412445/


All Articles