I'm a student and as a part of the yearly project I'm developing eclipse plug-in.
I've encountered a weird problem and trying to fix it for 2 days now:
I've added 3 new types of markers in the plugin.xml.
For every marker I added annotationTypes and for every annotationType I've added markerAnnotationSpecification.
My purpose is to color background lines.
In every markerAnnotationSpecification I've put different icons and different colorPreferenceValue.
The weird thing is this:
When creating the markers everything is fine and even the icons are shown (different icon for every marker) but the background color of the lines is the same for every markers.
I've noticed that the last markerAnnotationSpecification colorPreferenceValue is taken every time.
When I changed the order of the markerAnnotationSpecification in the plugin.xml, the color changed to the last one.
I don't know what to do?
Also I got to the preference page and changed there the annotation type color - after applying I saw it updated the 3 annotation type color to the same color.
Can't I add more then one (I don't think so...)
Can I control the markerAnnotationSpecification.colorPreferenceValue programmatically? If so, How?
I'm adding my code - maybe you would see what I don't see:
<extension id="BatonPassing.diff_marker_b"
name="SiteBDiffMarker"
point="org.eclipse.core.resources.markers">
<super type="org.eclipse.core.resources.textmarker"/>
<persistent value="true"/>
</extension>
<extension
point="org.eclipse.ui.editors.annotationTypes">
<type
name="diffAnnotationB"
super="org.eclipse.ui.workbench.texteditor.info"
markerType="BatonPassing.diff_marker_b">
<!--markerSeverity="0"-->
</type>
</extension>
<extension
point="org.eclipse.ui.editors.markerAnnotationSpecification">
<specification
icon = "icons/il.gif"
annotationType="diffAnnotationB"
verticalRulerPreferenceKey="highlight.rulers.vertical"
textPreferenceKey="highlight.text"
colorPreferenceKey="highlight.color"
highlightPreferenceKey="highlight.background"
textPreferenceValue="true"
textStylePreferenceValue="BOX"
overviewRulerPreferenceKey="highlight.rulers.overview"
presentationLayer="4"
highlightPreferenceValue="true"
label="DiffSiteB"
symbolicIcon="warning"
colorPreferenceValue="255,0,0"
verticalRulerPreferenceValue="true"
overviewRulerPreferenceValue="true"
textStylePreferenceKey="highlight.text.style" >
</specification >
</extension>
Every marker code is the same but the id's, names, colorPreferenceValue are not.
Please help me. Thank you very very much
Hadas
The colorPreferenceKey should be unique for each of your markerAnnotation specification. That should solve your problem.
If someone is still struggling with this problem. You need to change the presentationLayer attribute to be separate for every specification you have under the markerAnnotationSpecification. Preferably so that the highest priority annotation gets the smallest number i.e. 1 and the rest get incremental numbers from there on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With