Now we are ready to look at how to add help to the readme tool's markers. Adding marker help is done using the org.eclipse.ui.ide.markerHelp extension point. This extension point allows plug-ins to associate a help context id with a particular type of marker. The marker can be qualified by marker type only, or it can be further qualified by the value of one or more of its attributes. The readme tool declares several different help contexts:
<extension point="org.eclipse.ui.ide.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> ...
Each marker help context is defined for the readme marker type. However, each help context is associated with a different combination of attribute values. The first marker help context will be used for markers whose id attribute is set to "1234". The help contexts are defined in the plug-in's HelpContexts.xml file:
<context id="marker_example1_context" > <description>Readme marker example 1 <b>Help</b> id = 1234 </description> </context>
Sure enough, when we select a readme marker with id="1234" and select help using F1, we see our help in the help view.