How do I use “org.eclipse.debug.ui.launchShortcuts”?

蹲街弑〆低调 提交于 2019-12-04 10:55:36

It seems that the correct answer to this problem is to specify a contextual launch shortcut. 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>

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!