一旦使用对话框定义了启动配置,就可以将其显示在运行和/或调试菜单中。org.eclipse.debug.ui.launchShortcuts 扩展点用来注册启动快捷方式。在扩展定义中,可以指定以哪些方式(运行或调试)以及在哪些透视图中显示快捷方式。 对于每个快捷方式,必须指定 ILaunchShortcut 的实现。 如果在视图或编辑器中作出特定选择,此类就可以用来启动程序。
以下标记注册用于启动 Java 应用程序的快捷方式:
<extension point = "org.eclipse.debug.ui.launchShortcuts"> <shortcut id="org.eclipse.jdt.debug.ui.localJavaShortcut" class="org.eclipse.jdt.internal.debug.ui.launcher.JavaApplicationShortcut" label="%JavaApplicationShortcut.label" icon="icons/full/ctool16/java_app.gif" helpContextId="org.eclipse.jdt.debug.ui.shortcut_local_java_application" modes="run, debug"> <perspective id="org.eclipse.jdt.ui.JavaPerspective"/> <perspective id="org.eclipse.jdt.ui.JavaHierarchyPerspective"/> <perspective id="org.eclipse.jdt.ui.JavaBrowsingPerspective"/> <perspective id="org.eclipse.debug.ui.DebugPerspective"/> </shortcut> </extension>