關鍵字索引

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>


以下是使用索引延伸點的範例。

(在 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 檔中所提及的適當 manifest 檔就行了。

Eclipse 平台所提供的說明系統使用者介面之預設實作能充分支援 index 延伸點。