关键字索引

org.eclipse.help.index

3.2

用于为添加的帮助内容注册关键字。

<!ELEMENT extension (index*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT index EMPTY>

<!ATTLIST index

file CDATA #REQUIRED>


以下是使用 index 扩展点的一个示例。

(在 plugin.xml 文件中)

 

<extension point=

"org.eclipse.help.index"

>

<index file=

"index.xml"

/>

</extension>

(在 index.xml 文件中)

<index>
    <entry keyword="Vehicle">
        <topic href="inventory_of_wheel.html"/>
        <entry keyword="Car">
            <topic href="car.html"/>
        </entry>
        <entry keyword="Ship">
            <topic href="ship.html"/>
        </entry>
        <entry keyword="Airplane">
            <topic href="airplane.html" title="History of aviation"/>
            <topic href="jet.html" title="Jet engine"/>
        </entry>
    </entry>
    <entry keyword="Engine">
        <entry keyword="Horse">
            <topic href="horse.html"/>
        </entry>
        <entry keyword="Steamer">
            <topic href="steamer.html"/>
        </entry>
        <entry keyword="Wankel engine">
            <topic href="wankel.html"/>
        </entry>
        <entry keyword="Jet engine">
            <topic href="jet.html"/>
        </entry>
    </entry>
    <entry keyword="Electricity">
        <topic href="electricity.html"/>
    </entry>
</index>

国际化 可以对索引 XML 文件进行翻译,并且应该将生成的副本(包含已翻译的关键字)放在 nl/<language>/<country> 或 nl/<language> 目录中。<language> 和 <country> 表示语言环境代码中使用的双字母语言和国家或地区代码。例如,应该将繁体中文版本放在 nl/zh/TW 目录中。nl/<language>/<country> 目录的优先级高于 nl/<language>。仅当在 nl/<language>/<country> 目录中找不到文件时,才会使用 nl/<language> 中的文件。最后搜索插件的根目录。

使用此扩展点时不需要编写任何代码。您只需要提供 plugin.xml 文件中指定的适当清单文件。

Eclipse 平台附带提供的帮助系统 UI 的缺省实现完全支持 index 扩展点。