目錄(TOC)

識別碼:org.eclipse.help.toc

說明:用來登錄個別外掛程式的線上說明構成要素。

每個提供說明檔的外掛程式通常都應該執行下列動作:

配置標記:

   <!ELEMENT extension (toc*)>

   <!ATTLIST extension
     point CDATA #REQUIRED
     id    CDATA #IMPLIED
     name  CDATA #IMPLIED
   >

   <!ELEMENT toc EMPTY>

   <!ATTLIST toc
     file     CDATA #REQUIRED
      primary   (true | false) "false"
     extradir CDATA #IMPLIED
   >

範例:以下是使用 toc 延伸點的範例:

(在 plugin.xml 檔中)

 <extension point="org.eclipse.help.toc">
  <toc file="maindocs.html" primary="true"/>
  <toc file="task.xml"/>
  <toc file="sample.xml" extradir="samples"/>
   </extension> 

(在 maindocs.xml 檔中)

<toc label="Help System Example">
 <topic label="Introduction" href="intro.html"/>
 <topic label="Tasks">
  <topic label="Creating a Project" href="tasks/task1.html">
   <topic label="Creating a Web Project" href="tasks/task11.html"/>
   <topic label="Creating a Java Project" href="tasks/task12.html"/>
  </topic>
  <link toc="task.xml" />
  <topic label="Testing a Project" href="tasks/taskn.html"/>
 </topic>
 <topic label="Samples">
  <topic label="Creating Java Project" href="samples/sample1.html">
   <topic label="Launch a Wizard" href="samples/sample11.html"/>
   <topic label="Set Options" href="samples/sample12.html"/>
   <topic label="Finish Creating Project" href="samples/sample13.html"/>
  </topic>
  <anchor id="samples" />
 </topic>
</toc>


(在 tasks.xml 檔中)

<toc label="Building a Project">
 <topic label="Building a Project" href="build/building.html">
  <topic label="Building a Web Project" href="build/web.html"/>
  <topic label="Building a Java Project" href="build/java.html"/>
 </topic>
</toc>


(在 samples.xml 檔中)

<toc link_to="maindocs.xml#samples" label="Using The Compile Tool">
 <topic label="The Compile Tool Sample" href="compilesample/example.html">
  <topic label="Step 1" href="compilesample/step1.html"/>
  <topic label="Step 2" href="compilesample/step2.html"/>
  <topic label="Step 3" href="compilesample/step3.html"/>
  <topic label="Step 4" href="compilesample/step4.html"/>
 </topic>
</toc>

假設更多文件存在於以 samples 起始的路徑,它們將不會顯示在導覽樹狀結構中,但可以使用搜尋來存取。 這是因為在 plugin.xml 檔案<toc file="sample.xml" extradir="samples" /> 元素的 extradir 屬性的存在。 例如,搜尋「建立 Java 專案」會傳回「建立 Java 專案的其他方法」文件,路徑為 samples/sample2.html。

國際化字串 「TOC XML」檔可加以轉換,而且產生的副本(具有轉換的標籤)應該置於 nl/<language>/<country> 或 nl/<language> 目錄中。  <language> 和 <country> 代表在語言環境碼中使用、有兩個字母的語言碼和國碼。 例如,繁體中文轉換應該置於 nl/zh/TW 目錄中。   nl/<language>/<country> 目錄比起 nl/<language> 具有更高的優先順序。 僅在 nl/<language>/<country> 找不到檔案時,才會使用 nl/<language> 中常駐的檔案。 外掛程式的根目錄將放在最後搜尋。

可以藉由建立包含翻譯後版本文件的 doc.zip 檔,將這個 zip 檔中的文件本土化,並將 doc.zip 放置在
nl/<language>/<country> 或 nl/<language> 目錄下。在預設為 plugin 目錄前,說明系統將在這個目錄下尋找檔案。
 

API 資訊:使用這個延伸點不需要任何程式碼。只需要提供 plugin.xml 檔中所提及的適當 manifest 檔就行了。

提供的實作方式:Eclipse 平台所提供的說明系統 UI 之預設實作方式能充分支援 toc 延伸點。

Copyright (c) 2000, 2003 IBM Corporation and others.
All rights reserved. 這個程式和伴隨的素材可以根據伴隨這個分送,而且可在 http://www.eclipse.org/legal/cpl-v10.html 中取得的 Common Public License v1.0 的條款來使用