【问题标题】:Markers view shows my marker with a red square insted of error/warning icon标记视图用红色方块而不是错误/警告图标显示我的标记
【发布时间】: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> 

我也尝试了不同的超级类型,例如
&lt;super type="org.eclipse.core.resources.problemmarker"/&gt; 当我创建我设置的标记时:

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 作为超类型吗?

标签: java eclipse rcp marker


【解决方案1】:

尝试添加org.eclipse.ui.ide.markerImageProviders类型的扩展

<extension point="org.eclipse.ui.ide.markerImageProviders">
   <imageprovider
         markertype="com.ibm.mymarkers.mymarker"
         icon="marker.png"
         id="myImageProvider">
   </imageprovider>
</extension>

编辑

上述扩展点似乎不起作用(!)。 看看this SO question

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-11-04
    • 1970-01-01
    • 2018-07-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-07
    相关资源
    最近更新 更多