【发布时间】:2012-11-21 16:05:25
【问题描述】:
我根据 ibm 教程 Best practices for developing Eclipse plugins Using markers, annotations, and decorators 创建了自己的标记。
在我的插件 xml 中 我有这样的事情:
<extension point="org.eclipse.core.resources.markers"
id="com.ibm.mymarkers.mymarker"
name="My error">
<super type="org.eclipse.core.resources.textmarker"/>
<super type="org.eclipse.core.resources.marker"/>
<persistent value="true"/>
</extension>
我也尝试了不同的超级类型,例如<super type="org.eclipse.core.resources.problemmarker"/>
当我创建我设置的标记时:
marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
问题是标记显示在标记视图中但没有图标(基本上是红色方块)我如何为这些标记定义图标...?
我尝试了Vogella 中的简单示例,但我仍然没有看到创建标记的任何图像,但没有图像。
IMarker marker = res.createMarker(IMarker.TASK);
marker.setAttribute(IMarker.MESSAGE, "This a a task");
marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
我可能错过了一些包含这些图片的插件吗?
【问题讨论】:
-
你试过用 just questionmarker 作为超类型吗?