@Override protected MarkerAnnotation createMarkerAnnotation(IMarker marker) { MarkerAnnotation annotation = super.createMarkerAnnotation(marker); String issueCode = issueUtil.getCode(annotation); annotation.setQuickFixable(issueResolutionProvider.hasResolutionFor(issueCode)); return annotation; }
@Override public boolean canFix(Annotation annotation) { if (annotation.isMarkedDeleted()) { return false; } if (annotation instanceof MarkerAnnotation) { MarkerAnnotation markerAnnotation = (MarkerAnnotation) annotation; if (!markerAnnotation.isQuickFixableStateSet()) { markerAnnotation.setQuickFixable(quickFixer.hasResolutions(markerAnnotation.getMarker())); } return markerAnnotation.isQuickFixable(); } return false; }
public boolean canFix(Annotation annotation) { if (annotation.isMarkedDeleted()) return false; // non-persisted annotation if (annotation instanceof XtextAnnotation) { XtextAnnotation a = (XtextAnnotation) annotation; return getResolutionProvider().hasResolutionFor(a.getIssueCode()); } // persisted markerAnnotation if (annotation instanceof MarkerAnnotation) { MarkerAnnotation markerAnnotation = (MarkerAnnotation) annotation; if (!markerAnnotation.isQuickFixableStateSet()) markerAnnotation.setQuickFixable(getResolutionProvider().hasResolutionFor( issueUtil.getCode(markerAnnotation))); return markerAnnotation.isQuickFixable(); } if (annotation instanceof SpellingAnnotation) { return true; } return false; }