Eclipse PDE - marker annotation type - background color is not updated

I am a student, and as part of the annual project, I am developing an eclipse plugin.
I ran into some strange problem and tried to fix it for 2 days already:

I added 3 new marker types in plugin.xml.
For each marker I added annotationTypes, and for each annotationTypeI added markerAnnotationSpecification.
My goal is colored background lines.
In each markerAnnotationSpecificationI put different icons and different colorPreferenceValue.

The strange thing is that:
When creating markers, everything is fine and even the icons are displayed (different icons for each marker), but the background color of the lines is the same for each marker.
I noticed that the latter markerAnnotationSpecification colorPreferenceValueis taken every time.
When I changed the order markerAnnotationSpecificationin plugin.xml, the color changed to the last.

I do not know what to do?

I also got to the preferences page and changed the annotation type color there - after applying it, I saw that it updated the annotation type 3 color to one color.
I can’t add more than one (I don’t think so ...)
Can I manage the software markerAnnotationSpecification.colorPreferenceValue? If so, how?

I am adding my code - perhaps you will see what I do not 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>

Each marker code matches an identifier; names are colorPreferenceValuenot.

, . ! Hadas

+3
3

ColorPreferenceKey markerAnnotation. .

+2

- . presentationLayer, specification, markerAnnotationSpecification. , , 1, .

+1

Are you sure that you specify strings like marker identifier when creating them in your plugin Java code? Just a sanity check ...

0
source

Source: https://habr.com/ru/post/1702755/


All Articles