啟動捷徑

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>

perspective 元素在 3.1 版中已經廢除。現在,最上層的「執行/除錯/設定檔」階層式功能表可支援環境定義(可區分選項)啟動, 而用戶端應該改為提供 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 之中)。

class 屬性值必須是實作 org.eclipse.debug.ui.ILaunchShortcut 介面的完整 Java 類別名稱。

從 3.1 開始,除錯平台會針對每一個啟動捷徑及其適用模式來登錄一個指令處理常式,以容許用戶端為啟動捷徑定義按鍵連結。處理常式的指令 ID 會產生為啟動捷徑 ID 屬性,再加上一個句點和適用的啟動模式。例如,上述啟動捷徑範例的指令 ID 是 com.example.ExampleLaunchShortcutId.debug,代表在除錯模式中啟動。指令和按鍵連結可以依照下列方式來定義,以將 "ALT-SHIFT-D, E" 連結到啟動捷徑。

   

<extension point=

"org.eclipse.ui.commands"

>

<command name=

"除錯範例啟動"

description=

"除錯範例啟動"

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>