目次 (TOC)

org.eclipse.help.toc

個々のプラグインのオンライン・ヘルプのコントリビューションを登録します。

ヘルプ・ファイルを提供する各プラグインは、通常、以下のことを行います。

オプションとして、index エレメントを使用して検索索引を事前に構築し、登録して、最初の検索を試行することができます。登録できるのは、プラグインごとに 1 つの索引のみです。複数の index エレメントがあると、予期せぬ動作が発生します。

<!ELEMENT extension (toc* , index?)>

<!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>


<!ELEMENT index EMPTY>

<!ATTLIST index

path CDATA #REQUIRED>

(3.1 以降) このプラグインがコントリビュートする文書から作成された構築済み検索索引の宣言を可能にするオプションのエレメント



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"

/>

<index path=

"index/"

/>

</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" 属性が 存在するためです。  例えば、"Creating Java Project" を検索すると、 パスが samples/sample2.html の "Other Ways of Creating Java Project" という文書が返されます。

国際化対応 TOC XML ファイルは変換可能であり、結果のファイルは (変換済みラベルと共に) nl/<language>/<country> または nl/<language> ディレクトリーに置くことができます。  <language> と <country> は、ロケール・コードで使用する 2 文字の言語および国別コードを表します。  例えば、 中国語 (繁体字) 変換は、nl/zh/TW ディレクトリーに置かれる必要があります。  nl/<language>/<country> ディレクトリーは、 nl/<language> より優先順位が高くなります。  nl/<language>/<country> にファイルが見つからない場合のみ、 nl/<language> にあるファイルが使用されます。  プラグインのルート・ディレクトリーは、 最後に検索されます。

doc.zip に含まれるドキュメンテーションは、変換されたバージョンの文書で doc.zip ファイルを作成し、 doc.zip を
nl/<language>/<country> または nl/<language> ディレクトリーに配置する ことによりローカライズできます。 ヘルプ・システムは、プラグイン・ディレクトリーをデフォルトにする前に、このディレクトリー下にある ファイルを探します。
 

この拡張ポイントにコードは必要ありません。 plugin.xml ファイルに記された適切なマニフェスト・ファイルを指定するだけです。

Eclipse プラットフォームで提供されるヘルプ・システム UI のデフォルト実装は、toc 拡張ポイントを完全にサポートします。