gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 00:46:06 25 4
gpt4 key购买 nike

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

我在 plugin.xml 中添加了 3 种新类型的标记。
我为每个标记添加了 annotationTypes,为每个 annotationType 添加了 markerAnnotationSpecification
我的目的是为背景线着色。
在每个 markerAnnotationSpecification 中,我都放置了不同的图标和不同的 colorPreferenceValue

奇怪的是:
创建标记时,一切都很好,甚至显示图标(每个标记都有不同的图标),但线条的背景颜色对于每个标记都是相同的。
我注意到每次都采用最后一个 markerAnnotationSpecification colorPreferenceValue
当我更改 plugin.xmlmarkerAnnotationSpecification 的顺序时,颜色变为最后一个。

不知道怎么办?

我还进入了首选项页面并在那里更改了注释类型颜色 - 应用后我看到它将 3 种注释类型颜色更新为相同的颜色。
我不能加多一个吗(我不这么认为...)
我可以通过编程控制 markerAnnotationSpecification.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 不同。

请帮帮我。非常非常感谢
哈达斯

最佳答案

对于每个 markerAnnotation 规范,colorPreferenceKey 应该是唯一的。那应该可以解决您的问题。

关于Eclipse PDE - 标记注释类型 - 背景颜色未更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/516065/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com