启动快捷方式

org.eclipse.debug.ui.launchShortcuts

此扩展点对与选择相关的启动提供了支持。扩展注册一种快捷方式(它出现在运行和/或调试级联菜单中),以启动工作台选择或活动编辑器。

<!ELEMENT extension (shortcut*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT shortcut (perspective* , contextualLaunch? , enablement?)>

<!ATTLIST shortcut

id            CDATA #REQUIRED

modes         CDATA #REQUIRED

class         CDATA #REQUIRED

label         CDATA #REQUIRED

icon          CDATA #IMPLIED

category      CDATA #IMPLIED

helpContextId CDATA #IMPLIED

path          CDATA #IMPLIED>


<!ELEMENT perspective EMPTY>

<!ATTLIST perspective

id CDATA #REQUIRED>

3.1 发行版中已不推荐 perspective 元素。顶级“运行/调试/概要分析”级联菜单现在支持上下文(选择敏感)启动,并且客户机应提供 contextualLaunch 元素来代替。



<!ELEMENT contextualLaunch (contextLabel* , enablement?)>

保持有关将快捷方式添加至选择敏感“运行/调试/概要分析”级联菜单的所有描述。



<!ELEMENT contextLabel EMPTY>

<!ATTLIST contextLabel

mode  (run|debug|profile)

label CDATA #REQUIRED>

指定上下文启动方式的标签。



以下是启动快捷方式扩展点的一个示例:

 

<extension point=

"org.eclipse.debug.ui.launchShortcuts"

>

<shortcut id=

"com.example.ExampleLaunchShortcutId"

modes=

"run,debug"

class=

"com.example.ExampleLaunchShortcutImpl"

label=

"Example Launch Shortcut"

icon=

"icons/examples.gif"

>

<perspective id=

"org.eclipse.jdt.ui.JavaPerspective"

/>

<perspective id=

"org.eclipse.debug.ui.DebugPerspective"

/>

</shortcut>

</extension>

在上面的示例中,启动快捷方式将显示在 JavaPerspective 和 DebugPerspective 中标签为“Example Launch Shortcut”的运行和调试级联菜单中。

class 属性的值必须是实现 org.eclipse.debug.ui.ILaunchShortcut 接口的 Java 类的标准名称。

从 3.1 开始,调试平台为每个启动快捷方式及其适用的方式注册一个命令处理程序,以允许客户机为启动快捷方式定义键绑定。处理程序的命令标识将作为启动快捷方式标识属性生成,后跟一个点和适用的启动方式。例如,以上启动快捷方式示例的命令标识将为 com.example.ExampleLaunchShortcutId.debug,用于在调试方式下启动。命令和键绑定可以定义如下,以将“ALT-SHIFT-D, E”绑定至启动快捷方式。

   

<extension point=

"org.eclipse.ui.commands"

>

<command name=

"Debug Example Launch"

description=

"Debug Example Launch"

categoryId=

"org.eclipse.debug.ui.category.run"

id=

"com.example.ExampleLaunchShortcutId.debug"

>

</command>

<keyBinding keySequence=

"M3+M2+D E"

contextId=

"org.eclipse.ui.globalScope"

commandId=

"com.example.ExampleLaunchShortcutId.debug"

keyConfigurationId=

"org.eclipse.ui.defaultAcceleratorConfiguration"

>

</keyBinding>

</extension>