use of net.sourceforge.pmd.eclipse.ui.views.ViolationOverview in project pmd-eclipse-plugin by pmd.
the class PMDRemoveMarkersAction method processElement.
private void processElement(Object element) throws CoreException {
if (element instanceof AbstractPMDRecord) {
final AbstractPMDRecord record = (AbstractPMDRecord) element;
final IResource resource = record.getResource();
if (isViolationOverview()) {
((ViolationOverview) targetPart()).deleteMarkers(record);
}
LOG.debug("Remove markers on resource " + resource.getName());
} else if (element instanceof IAdaptable) {
final IAdaptable adaptable = (IAdaptable) element;
final IResource resource = (IResource) adaptable.getAdapter(IResource.class);
if (resource == null) {
LOG.warn("The selected object cannot adapt to a resource");
LOG.debug(" -> selected object : " + element);
} else {
MarkerUtil.deleteAllMarkersIn(resource);
LOG.debug("Remove markers on resrouce " + resource.getName());
}
} else {
LOG.warn("The selected object is not adaptable");
LOG.debug(" -> selected object : " + element);
}
}
Aggregations