Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse PDE-标记注释类型-背景颜色未更新_Eclipse - Fatal编程技术网

Eclipse PDE-标记注释类型-背景颜色未更新

Eclipse PDE-标记注释类型-背景颜色未更新,eclipse,Eclipse,我是一名学生,作为年度项目的一部分,我正在开发eclipse插件。 我遇到了一个奇怪的问题,并尝试修复了2天: 我在plugin.xml中添加了3种新的标记类型 对于我添加的每个标记注释类型,以及对于每个注释类型我添加的标记注释规范 我的目的是给背景线上色。 在每个markernotationspecification中,我都放置了不同的图标和不同的colorPreferenceValue 奇怪的是: 创建标记时,一切正常,甚至显示图标(每个标记的图标不同),但每个标记的线条背景色相同。 我注意

我是一名学生,作为年度项目的一部分,我正在开发eclipse插件。
我遇到了一个奇怪的问题,并尝试修复了2天:

我在
plugin.xml
中添加了3种新的标记类型
对于我添加的每个标记
注释类型
,以及对于每个
注释类型
我添加的
标记注释规范

我的目的是给背景线上色。
在每个
markernotationspecification
中,我都放置了不同的图标和不同的
colorPreferenceValue

奇怪的是:
创建标记时,一切正常,甚至显示图标(每个标记的图标不同),但每个标记的线条背景色相同。
我注意到,每次都会使用最后一个
markerNotationSpecification colorPreferenceValue

当我更改
plugin.xml
markernotationspecification
的顺序时,颜色变为最后一种

我不知道该怎么办

我还进入了首选项页面,在那里更改了注释类型颜色-应用后,我看到它将3个注释类型的颜色更新为相同的颜色。
我不能再添加一个吗(我不这么认为…)
我能否以编程方式控制
markerNotationSpecification.colorPreferenceValue
?如果是,怎么做

我正在添加我的代码-也许你会看到我没有看到的东西:

  <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>

每个标记代码都相同,但id、名称、
colorPreferenceValue
不相同

请帮帮我。非常感谢

Hadas

在插件的Java代码中创建标记ID类型字符串时,您确定要指定不同的标记ID类型字符串吗?只是一个健全的检查…

对于您的每个标记符号规范,colorPreferenceKey应该是唯一的。这应该能解决你的问题。

如果有人还在为这个问题挣扎。您需要将
presentationLayer
属性更改为对于
markernotationspecification
下的每个
specification
都是独立的。最好是使最高优先级的注释获得最小的数字,即
1
,其余注释从那里获得递增的数字