<!ELEMENT extension (itemExtension)*>
<!ATTLIST extension
point CDATA #REQUIRED
id CDATA #IMPLIED
name CDATA #IMPLIED>
<!ELEMENT itemExtension EMPTY>
<!ATTLIST itemExtension
itemAttribute CDATA #REQUIRED
class CDATA #REQUIRED>
使用此项扩展来将元素添加至备忘单步骤。可以使用此扩展点来为备忘单中的步骤添加图标和按钮(当前,在帮助图标的旁边)。指定将放置到备忘单 item 标记中的属性的名称。还指定在装入备忘单时将处理备忘单内容文件中的属性值的解析的类。属性值必须是字符串。指定的类必须成为 org.eclipse.ui.cheatsheets.AbstractItemExtensionElement
的子类。在对备忘单内容文件进行解析并且装入它之后,就会通过接口再次调用在扩展点中指定的类,以便向备忘单中的步骤添加图形或按钮(当前,在帮助按钮旁边)。
org.eclipse.ui.cheatsheets.AbstractItemExtensionElement
的子类的类标准类名,该类用来处理备忘单内容文件中的未知属性并扩展备忘单中的步骤。该类必须是公用的,并且具有公用的 1 个自变量的构造函数,该构造函数接受属性名(String
)。
以下是该扩展的 item 属性:<extension point=
"org.eclipse.ui.cheatsheets.cheatSheetItemExtension"
>
<itemExtension itemAttribute=
"xyzButton"
class=
"com.example.HandleParsingAndAddButton"
>
</itemExtension>
</extension>
注意,item 标记中的属性的值可以是“任何内容”。它可以是任何内容,这是因为 对该属性进行解析的类是 HandleParsingAndAddButton 类,在此示例中该类将对属性中的字符串 /icon/button.gif 进行解析。稍后它将使用该信息来装入 gif 文件并将它用作新按钮的图标。<item title=
"XYZ Title"
xyzButton=
"/icon/button.gif"
/>
Copyright (c) 2004, 2005 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