2013-01-16 29 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 :)