<!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>
org.eclipse.debug.ui.ILaunchShortcut
的类的标准名称。null
(缺省值)。path
属性按字母顺序对启动快捷方式进行分组,然后基于 label
属性在组中按字母顺序进行排序。当未指定此项时,一个快捷方式出现在最后一个组中。在 3.0.1 发行版中添加了此属性。<!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>
指定上下文启动方式的标签。
<!ELEMENT enablement (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
通用根元素。可以在扩展点内使用该元素来定义它的支持表达式。将使用 and 运算符来组合 enablement 表达式的子代。
<!ELEMENT not (not | and | or | instanceof | test | systemTest | equals | count | with | resolve | adapt | iterate)>
此元素表示对其子元素表达式求值的结果的 NOT 操作。
<!ELEMENT and (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
此元素表示对其所有子元素表达式求值的结果执行 AND 操作。
<!ELEMENT or (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
此元素表示对其所有子元素表达式求值的结果执行 OR 操作。
<!ELEMENT instanceof EMPTY>
<!ATTLIST instanceof
value CDATA #REQUIRED>
此元素用来对焦点中的对象执行 instanceof 检查。如果对象的类型是由属性值指定的类型的子类型,则表达式返回 EvaluationResult.TRUE。否则,将返回 EvaluationResult.FALSE。
<!ELEMENT test EMPTY>
<!ATTLIST test
property CDATA #REQUIRED
args CDATA #IMPLIED
value CDATA #IMPLIED>
此元素用来对焦点中对象的属性状态进行评估。可以使用属性测试程序扩展点来扩展可测试属性的集合。如果尚未装入执行实际测试的属性测试程序,则测试表达式返回 EvaluationResult.NOT_LOADED。
<!ELEMENT systemTest EMPTY>
<!ATTLIST systemTest
property CDATA #REQUIRED
value CDATA #REQUIRED>
通过调用 System.getProperty 方法来测试系统属性并将结果与通过值属性指定的值进行比较。
<!ELEMENT equals EMPTY>
<!ATTLIST equals
value CDATA #REQUIRED>
此元素用来对焦点中的对象执行等于检查。如果对象等于由属性值提供的值,则表达式返回 EvaluationResult.TRUE。否则,将返回 EvaluationResult.FALSE。
<!ELEMENT count EMPTY>
<!ATTLIST count
value CDATA #REQUIRED>
此元素用来测试集合中的元素数。
<!ELEMENT with (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
<!ATTLIST with
variable CDATA #REQUIRED>
此元素将把要检查以获取其所有子元素的对象更改为由给定变量引用的对象。如果不能解析变量,则表达式将在对变量求值时抛出 ExpressionException。将使用 and 运算符来组合 with 表达式的子代。
<!ELEMENT resolve (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
<!ATTLIST resolve
variable CDATA #REQUIRED
args CDATA #IMPLIED>
此元素将把要检查以获取其所有子元素的对象更改为由给定变量引用的对象。如果不能解析变量,则表达式将在对变量求值时抛出 ExpressionException。将使用 and 运算符来组合 with 表达式的子代。
<!ELEMENT adapt (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
<!ATTLIST adapt
type CDATA #REQUIRED>
此元素用来使焦点中的对象适用于由属性类型指定的类型。如果尚未装入适配器或引用的类型,则表达式返回 not loaded。如果类型名称根本不存在,则表达式在求值期间将抛出 ExpressionException。将使用 and 运算符来组合 adapt 表达式的子代。
<!ELEMENT iterate (not , and , or , instanceof , test , systemTest , equals , count , with , resolve , adapt , iterate)*>
<!ATTLIST iterate
operator (or|and) >
此元素用来叠代类型为 java.util.Collection 的变量。如果焦点中对象的类型不是 java.util.Collection,则当对表达式求值时将抛出 ExpressionException。
在上面的示例中,启动快捷方式将显示在 JavaPerspective 和 DebugPerspective 中标签为“Example Launch Shortcut”的运行和调试级联菜单中。<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>
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>
Copyright (c) 2000, 2006 IBM Corporation and others.
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License v1.0 which
accompanies
this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html