I want to specify a custom icon for a marker. Sadly, the icon that I chose is not displayed.
Here’s the relevant parts of the plugin.xml file (the project id “x”):
<extension
id="xmlProblem"
name="XML Problem"
point="org.eclipse.core.resources.markers">
<super type="org.eclipse.core.resources.problemmarker"/>
<persistent
value="true">
</persistent>
</extension>
<extension
point="org.eclipse.ui.ide.markerImageProviders">
<imageprovider
markertype="x.xmlProblem"
icon="icons/marker.png"
id="xmlProblemImageProvider">
</imageprovider>
</extension>
I also tried specifying a class (implementing IMarkerImageProvider) instead of an icon, but that getImagePath() method of the class does not get called.
Any thoughts on how to make custom marker icons work?
Desperately, yours.
-Itay
Update
VonC’s solution is pretty much correct, except that you must not specify org.eclipse.core.resources.problemmarker as a supertype of your marker. It worked only when I used org.eclipse.core.resources.textmarker as the only supertype.
See bug 260909 "markerImageProviders extension point does not work" (found after reading this thread)
[EDIT by Itay]
Following on Vonc’s pointers, I eventually managed to make this thing work.
Here are the relevant fragments from my
plugin.xml(assuming the plugin name isa.b.c)Pitfalls
org.eclipse.core.resources.textmarker. Any other value will prevent your custom icon from being used.markerSeverityattribute at theorg.eclipse.ui.editors.annotationTypesextension point.1means warning, etc.