Exemplo n.º 1
0
 public static IMarker[] getProblemsFor(IResource resource) {
   try {
     if (resource != null && resource.exists()) {
       IMarker[] markers =
           resource.findMarkers(
               IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_INFINITE);
       Set markerTypes =
           JavaModelManager.getJavaModelManager().compilationParticipants.managedMarkerTypes();
       if (markerTypes.isEmpty()) return markers;
       ArrayList markerList = new ArrayList(5);
       for (int i = 0, length = markers.length; i < length; i++) {
         markerList.add(markers[i]);
       }
       Iterator iterator = markerTypes.iterator();
       while (iterator.hasNext()) {
         markers = resource.findMarkers((String) iterator.next(), false, IResource.DEPTH_INFINITE);
         for (int i = 0, length = markers.length; i < length; i++) {
           markerList.add(markers[i]);
         }
       }
       IMarker[] result;
       markerList.toArray(result = new IMarker[markerList.size()]);
       return result;
     }
   } catch (CoreException e) {
     // assume there are no problems
   }
   return new IMarker[0];
 }
Exemplo n.º 2
0
 public static IMarker[] getTasksFor(IResource resource) {
   try {
     if (resource != null && resource.exists())
       return resource.findMarkers(IJavaModelMarker.TASK_MARKER, false, IResource.DEPTH_INFINITE);
   } catch (CoreException e) {
     // assume there are no tasks
   }
   return new IMarker[0];
 }
Exemplo n.º 3
0
 protected void collectBrakePoint(IResource resource) throws CoreException {
   fBreakpoints = new BucketMap<IResource, IBreakpoint>(6);
   fBreakpointAttributes = new HashMap<IBreakpoint, Map<String, Object>>(6);
   final IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
   IMarker[] markers =
       resource.findMarkers(IBreakpoint.LINE_BREAKPOINT_MARKER, true, IResource.DEPTH_INFINITE);
   for (IMarker marker : markers) {
     IResource markerResource = marker.getResource();
     IBreakpoint breakpoint = breakpointManager.getBreakpoint(marker);
     if (breakpoint != null) {
       fBreakpoints.add(markerResource, breakpoint);
       fBreakpointAttributes.put(breakpoint, breakpoint.getMarker().getAttributes());
     }
   }
 }