I am implementing QuickFix in my RCP application.
I added org.eclipse.ui.ide.markerResolution and created a class implementing IMarkerResolutionGenerator2 interface.
public class MyResolutionGenerator implements
IMarkerResolutionGenerator2 {
@Override
public IMarkerResolution[] getResolutions(IMarker marker) {
....
}
@Override
public boolean hasResolutions(IMarker marker) {
return true;
}
}
I also created resolutions and everything is working fine.
Moment I add attributes to extension points org.eclipse.ui.ide.markerResolution, the quick fix option in the problem view always comes disabled.
<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>
No exceptions thrown nothing but I am not able to figure out the reason for it.
I got the solution. Mistake was at my end only.
The attribute added must be present in the marker. Attribute added test was not present for the marker com.priyank.test.model_marker, hence the hasResolution from MarkerHelpRegistry was returning false 🙂