マーカー・ヘルプの組み込み

ヘルプを README ツールのマーカーに追加する方法を調べる準備が整いました。  マーカー・ヘルプの追加は、org.eclipse.ui.markerHelp 拡張ポイントを使用して行われます。  この拡張ポイントを使用すると、ヘルプ・コンテキスト ID と特定のタイプのマーカーとをプラグインが関連付けることができます。  マーカーは、マーカー・タイプのみによって修飾でき、1 つまたは複数の属性の値によって、さらに装飾できます。  README ツールは、いくつかのヘルプ・コンテキストを宣言します。

<extension point="org.eclipse.ui.markerHelp"> 
   <markerHelp 
      markerType="org.eclipse.ui.examples.readmetool.readmemarker" 
      helpContextId="org.eclipse.ui.examples.readmetool.marker_example1_context"> 
      <attribute name="org.eclipse.ui.examples.readmetool.id" value= "1234"/> 
   </markerHelp> 
   <markerHelp 
      markerType="org.eclipse.ui.examples.readmetool.readmemarker" 
      helpContextId="org.eclipse.ui.examples.readmetool.marker_example2_context"> 
      <attribute name="org.eclipse.ui.examples.readmetool.level" value= "7"/> 
   </markerHelp> 
   <markerHelp 
      markerType="org.eclipse.ui.examples.readmetool.readmemarker" 
      helpContextId="org.eclipse.ui.examples.readmetool.marker_example3_context"> 
      <attribute name="org.eclipse.ui.examples.readmetool.level" value= "7"/> 
      <attribute name="org.eclipse.ui.examples.readmetool.department" value= "infra"/> 
   </markerHelp> 
   ...

各マーカー・ヘルプ・コンテキストは、README マーカー型用に定義されます。  ただし、それぞれのヘルプ・コンテキストは、別々の属性値の組み合わせと関連付けられます。  最初のマーカー・ヘルプ・コンテキストは、id 属性が "1234" に設定されているマーカーのために使用されます。  ヘルプ・コンテキストは、以下のようにプラグインの HelpContexts.xml ファイル内に定義されます。

<context id="marker_example1_context" >
	<description>Readme marker example 1 <b>Help</b> id = 1234 </description>
</context>

実際、README マーカーを id="1234" で選択し、F1 を使用してヘルプを選択すると、ヘルプ記述が表示されます。

マーカー・ヘルプのあるタスク・リスト

Copyright IBM Corporation and others 2000, 2003.