예제 #1
0
 @Override
 public void resourceChanged(final IResourceChangeEvent event) {
   for (final IMarkerDelta delta : event.findMarkerDeltas(IMarker.BOOKMARK, false)) {
     if (delta.getResource().equals(fFile)) {
       if (delta.getKind() == IResourceDelta.REMOVED) {
         final IMarker bookmark = delta.getMarker();
         Display.getDefault()
             .asyncExec(
                 new Runnable() {
                   @Override
                   public void run() {
                     fEventsTable.removeBookmark(bookmark);
                   }
                 });
       } else if (delta.getKind() == IResourceDelta.CHANGED) {
         Display.getDefault()
             .asyncExec(
                 new Runnable() {
                   @Override
                   public void run() {
                     fEventsTable.getTable().refresh();
                   }
                 });
       }
     }
   }
 }
예제 #2
0
  /**
   * Processes a {@link IMarker} change.
   *
   * @param markerDeltas the list of {@link IMarkerDelta}
   */
  private void processMarkerChanges(IMarkerDelta[] markerDeltas) {
    AndroidManifestDescriptors descriptors = getManifestDescriptors();
    if (descriptors != null && descriptors.getApplicationElement() != null) {
      UiElementNode app_ui_node =
          mUiManifestNode.findUiChildNode(descriptors.getApplicationElement().getXmlName());
      List<UiElementNode> children = app_ui_node.getUiChildren();

      for (IMarkerDelta markerDelta : markerDeltas) {
        processMarker(markerDelta.getMarker(), children, markerDelta.getKind());
      }
    }
  }
예제 #3
0
 private boolean isErrorDelta(IResourceDelta delta) {
   if ((delta.getFlags() & IResourceDelta.MARKERS) != 0) {
     IMarkerDelta[] markerDeltas = delta.getMarkerDeltas();
     for (IMarkerDelta markerDelta : markerDeltas) {
       if (markerDelta.isSubtypeOf(IMarker.PROBLEM)) {
         int kind = markerDelta.getKind();
         if (kind == IResourceDelta.ADDED || kind == IResourceDelta.REMOVED) return true;
         int severity = markerDelta.getAttribute(IMarker.SEVERITY, -1);
         int newSeverity = markerDelta.getMarker().getAttribute(IMarker.SEVERITY, -1);
         if (newSeverity != severity) return true;
       }
     }
   }
   return false;
 }