Following this post, I had a hard time to figure out how to add a custom icon to my custom marker. But finally… . The only difference is that I removed the markerSeverity attribute from the annotationTypes extension point.

This “correction” may only be valid for Eclipse 3.7.1 (Indigo). Try it yourself and if you have any corrections just leave a comment.🙂

<extension
 id="MyMarker"
 point="org.eclipse.core.resources.markers"
 name="MyMarker">
 <super type="org.eclipse.core.resources.textmarker" />
 <persistent value="false" />
</extension>

<extension point="org.eclipse.ui.editors.annotationTypes">
 <type
 super="org.eclipse.ui.workbench.texteditor.warning"
 markerType="a.b.c.MyMarker"
 name="a.b.c.MyMarkerAnnotation"/>
</extension>

<extension point="org.eclipse.ui.editors.markerAnnotationSpecification">
 <specification
 annotationType="a.b.c.MyMarkerAnnotation"
 icon="icons/myMarkerIcon.png" />
</extension>

Good luck!