blob: 023194c53a8889437714852e8897d7cafacab334 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML>
<HEAD>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css">
<TITLE>
Contributing marker help
</TITLE>
<link rel="stylesheet" type="text/css" HREF="../book.css">
</HEAD>
<BODY BGCOLOR="#ffffff">
<h4>Contributing marker help</h4>
<p>Now we are ready to look at how to add help to the readme tool's
markers.&nbsp; Adding marker help is done using the <b><a href="../reference/extension-points/org_eclipse_ui_ide_markerHelp.html">org.eclipse.ui.ide.markerHelp</a></b>
extension point.&nbsp; This extension point allows plug-ins to associate a help
context id with a particular type of marker.&nbsp; 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.&nbsp; The readme tool declares several different help contexts:</p>
<pre>&lt;extension point=&quot;org.eclipse.ui.ide.markerHelp&quot;&gt;
&lt;markerHelp
<b>markerType=&quot;org.eclipse.ui.examples.readmetool.readmemarker&quot; </b>
helpContextId=&quot;org.eclipse.ui.examples.readmetool.marker_example1_context&quot;&gt;
<b> &lt;attribute name=&quot;org.eclipse.ui.examples.readmetool.id&quot; value= &quot;1234&quot;/&gt; </b>
&lt;/markerHelp&gt;
&lt;markerHelp
markerType=&quot;org.eclipse.ui.examples.readmetool.readmemarker&quot;
helpContextId=&quot;org.eclipse.ui.examples.readmetool.marker_example2_context&quot;&gt;
&lt;attribute name=&quot;org.eclipse.ui.examples.readmetool.level&quot; value= &quot;7&quot;/&gt;
&lt;/markerHelp&gt;
&lt;markerHelp
markerType=&quot;org.eclipse.ui.examples.readmetool.readmemarker&quot;
helpContextId=&quot;org.eclipse.ui.examples.readmetool.marker_example3_context&quot;&gt;
&lt;attribute name=&quot;org.eclipse.ui.examples.readmetool.level&quot; value= &quot;7&quot;/&gt;
&lt;attribute name=&quot;org.eclipse.ui.examples.readmetool.department&quot; value= &quot;infra&quot;/&gt;
&lt;/markerHelp&gt;
...</pre>
<p>Each marker help context is defined for the readme marker type.&nbsp;
However, each help context is associated with a different combination of
attribute values.&nbsp; The first marker help context will be used for markers
whose <b>id</b> attribute is set to <b>&quot;1234&quot;</b>.&nbsp; The help
contexts are defined in the plug-in's <b>HelpContexts.xml </b>file:</p>
<pre>&lt;context id=&quot;marker_example1_context&quot; &gt;
&lt;description&gt;Readme marker example 1 &lt;b&gt;Help&lt;/b&gt; id = 1234 &lt;/description&gt;
&lt;/context&gt;</pre>
<p>Sure enough, when we select a readme marker with id=&quot;1234&quot; and select
help using F1, we see our help in the help view. </p>
<p><img src="images/readmemarkerhelp.png" alt="Tasks list with marker help" border="0" ></p>
</BODY>
</HTML>