2013-01-16 25 views
1

我在我的RCP应用程序中实现QuickFix。快速修复 - 添加属性到扩展org.eclipse.ui.ide.markerResolution

我添加了org.eclipse.ui.ide.markerResolution并创建了一个实现IMarkerResolutionGenerator2接口的类。

public class MyResolutionGenerator implements 
    IMarkerResolutionGenerator2 { 

    @Override 
    public IMarkerResolution[] getResolutions(IMarker marker) { 
     .... 
    } 

    @Override 
    public boolean hasResolutions(IMarker marker) { 
     return true; 
    } 
} 

我也创造了决议,一切工作正常。

当我将属性添加到扩展点org.eclipse.ui.ide.markerResolution时,问题视图中的快速修复选项始终禁用。

<extension 
    point="org.eclipse.ui.ide.markerResolution"> 
    <markerResolutionGenerator 
     class="com.priyank.visual.quickfix.MyResolutionGenerator" 
     markerType="com.priyank.test.model_marker"> 
     <attribute 
      name="test" 
      value="testdata"> 
     </attribute> 
</markerResolutionGenerator> 

没有任何异常抛出,但我无法找出它的原因。

回答

1

我得到了解决方案。错误只在我的最后。

添加的属性必须存在于标记中。标记com.priyank.test.model_marker不存在属性添加测试,因此MarkerHelpRegistry的hasResolution返回false :)