@Override public boolean canFix(Annotation annotation) { boolean bRetVal = false; if (annotation instanceof SimpleMarkerAnnotation) { // check local resolutions first IMarker marker = ((SimpleMarkerAnnotation) annotation).getMarker(); IMarkerResolution[] localResolutions = fGenerator.getResolutions(marker); if (localResolutions.length > 0) { bRetVal = true; } // check the contributed resolutions if needed if (!bRetVal) { IMarkerResolution[] contributedResolutions = IDE.getMarkerHelpRegistry().getResolutions(marker); if (contributedResolutions.length > 0) { bRetVal = true; } } } return bRetVal; }
private void populateDataModelForAnnotation(SimpleMarkerAnnotation annotation) { // grab the local resolutions first IMarker marker = annotation.getMarker(); if (!fResMap.containsKey(marker)) { ArrayList<IMarkerResolution> resolutions = new ArrayList<>(5); IMarkerResolution[] localResolutions = fGenerator.getResolutions(marker); resolutions.addAll(Arrays.asList(localResolutions)); // grab the contributed resolutions IMarkerResolution[] contributedResolutions = IDE.getMarkerHelpRegistry().getResolutions(marker); for (int i = 0; i < contributedResolutions.length; i++) { IMarkerResolution resolution = contributedResolutions[i]; // only add contributed marker resolutions if they don't come from PDE if (!(resolution instanceof AbstractPDEMarkerResolution) && !resolutions.contains(contributedResolutions[i])) resolutions.add(contributedResolutions[i]); } if (resolutions.size() > 0) { fResMap.put(marker, resolutions.toArray(new IMarkerResolution[resolutions.size()])); } } }