ContentGeneratorDescriptor descriptor =
MarkerSupportRegistry.getInstance().getDefaultContentGenDescriptor();
ExtendedMarkersView view = new ExtendedMarkersView(descriptor.getId());
String viewId = IPageLayout.ID_PROBLEM_VIEW;
MarkerContentGenerator generator = new MarkerContentGenerator(
descriptor, new CachedMarkerBuilder(view), viewId);
// hack to disable loading the gui configured filters
Field enabledFilters = MarkerContentGenerator.class
.getDeclaredField("enabledFilters");
enabledFilters.setAccessible(true);
enabledFilters.set(generator, new HashSet());
Method gatherMarkers = MarkerContentGenerator.class
.getDeclaredMethod("gatherMarkers",
String[].class, Boolean.TYPE, Collection.class, IProgressMonitor.class);
gatherMarkers.setAccessible(true);
ArrayList markers = new ArrayList();
gatherMarkers.invoke(generator,
generator.getTypes(), true, markers, new NullProgressMonitor());
ArrayList<Error> problems = new ArrayList<Error>();
if (markers.size() == 0){
return problems;
}