protected void deleteMarkers(IFile file) {
   try {
     file.deleteMarkers(IMarker.PROBLEM, true, IResource.DEPTH_ONE);
   } catch (CoreException e) {
     // an error while marking an error, lets throw it
   }
 }
Esempio n. 2
0
 /*
  * (non-Javadoc)
  *
  * @see featureide.core.internal.IMarkerHandler#deleteAllModelMarkers()
  */
 public void deleteAllModelMarkers() {
   try {
     if (project.isAccessible()) project.deleteMarkers(MODEL_MARKER, false, IResource.DEPTH_ZERO);
     if (modelFile.exists()) modelFile.deleteMarkers(MODEL_MARKER, false, IResource.DEPTH_ZERO);
   } catch (CoreException e) {
     e.printStackTrace();
   }
 }
Esempio n. 3
0
  private synchronized void updateMarkers(
      IFile file, Map<String, Collection<IProblem>> itemsByType, IProgressMonitor monitor) {
    if (!file.exists()) {
      // no need to update the marker when the resource no longer exists
      return;
    }
    SubMonitor sub = SubMonitor.convert(monitor, itemsByType.size() * 10);

    // FIXME Do a diff like we do in ValidationManager!
    for (String markerType : itemsByType.keySet()) {
      try {
        Collection<IProblem> newItems = itemsByType.get(markerType);
        // deletes the old markers
        file.deleteMarkers(markerType, false, IResource.DEPTH_INFINITE);
        sub.worked(1);

        // adds the new ones
        addMarkers(newItems, markerType, file, sub.newChild(9));
      } catch (CoreException e) {
        IdeLog.logError(BuildPathCorePlugin.getDefault(), e);
      }
    }
    sub.done();
  }
Esempio n. 4
0
 /**
  * Utility to remove all CIMTool markers from a file.
  *
  * @param file: the file
  * @throws CoreException
  */
 public static void removeMarkers(IFile file) throws CoreException {
   if (file.exists()) file.deleteMarkers(MARKER_TYPE, false, IResource.DEPTH_ZERO);
 }