Hi
Im creating custom Marker solution using JDT/AST.
I have additional data about the resolution that is in HTML format. I would like to show this HTML data in Marker Proposal window (see Attached file).
I have given below the code from getResolutions() method of IMarkerResolutionGenerator2 class. IN this method, the cariable 'resolutionDescription' has the HTML content that need to displayed as additional property of marker resolution.
Can you let me know what changes I have to to do to get the HTML content?
@Override
public IMarkerResolution[] getResolutions(IMarker paramIMarker) {
IMarkerResolution2[] markerResolutions = null;
ArrayList<IMarkerResolution2> markerResolutionsList = new ArrayList<IMarkerResolution2>();
List<ResolutionType> resolutionTypes = registry.getResolutions();
Map<String, Set<Integer>> resolutionIndicesMap = registry
.getRulewiseResolutions();
String markerRuleName = paramIMarker.getAttribute(
MarkerFactory.VIOLATED_RULE_NAME, MarkerFactory.STRING_NA);
// Handling multiple resolutions for same Rule
for (Integer resolutionIndex : resolutionIndicesMap.get(markerRuleName)) {
IConfigurationElement resolutionElement = resolutionTypes.get(
resolutionIndex).getResolutionElement();
String resolutionClassName = resolutionElement
.getAttribute(ResolutionType.ATTR_CLASS);
String resolutionRuleInfo = resolutionElement
.getAttribute(ResolutionType.ATTR_INFO);
String markerRuleDesc= paramIMarker.getAttribute(
MarkerFactory.VIOLATED_RULE_DESC, MarkerFactory.STRING_NA);
if (MarkerFactory.STRING_NA.equals(resolutionClassName)
|| MarkerFactory.STRING_NA.equals(resolutionRuleInfo)) {
continue;
}
Constructor<?> constructor = (Constructor<?>) Class.forName(
resolutionClassName).getDeclaredConstructor(
String.class, String.class);
if (null == constructor) {
continue;
}
String resolutionDescription = null;
if (!MarkerFactory.STRING_NA.equals(markerRuleDesc)) {
resolutionDescription.append(markerRuleDesc);
}
Object resolutionClass = constructor.newInstance(
resolutionRuleInfo, resolutionDescription);
if (null == resolutionClass
|| !(resolutionClass instanceof IMarkerResolution2)) {
continue;
}
markerResolutionsList.add((IMarkerResolution2) resolutionClass);
}
if (!markerResolutionsList.isEmpty()) {
// Set the fetched results
markerResolutions = markerResolutionsList
.toArray(new IMarkerResolution2[markerResolutionsList
.size()]);
}
return markerResolutions;
}