@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(); } }); } } } }
private static int hasSpawnpointChanges(IMarkerDelta delta, IScriptBreakpoint breakpoint) { final String[] attrs = breakpoint.getUpdatableAttributes(); try { final IMarker marker = delta.getMarker(); for (int i = 0; i < attrs.length; ++i) { final String attr = attrs[i]; if (IBreakpoint.ENABLED.equals(attr) || IMarker.LINE_NUMBER.equals(attr)) { final Object oldValue = delta.getAttribute(attr); final Object newValue = marker.getAttribute(attr); if (oldValue == null) { if (newValue != null) { return IMarker.LINE_NUMBER.equals(attr) ? MAJOR_CHANGE : MINOR_CHANGE; } continue; } if (newValue == null) { return IMarker.LINE_NUMBER.equals(attr) ? MAJOR_CHANGE : MINOR_CHANGE; } if (!oldValue.equals(newValue)) { return IMarker.LINE_NUMBER.equals(attr) ? MAJOR_CHANGE : MINOR_CHANGE; } } } } catch (CoreException e) { DLTKDebugPlugin.log(e); } return NO_CHANGES; }
private int hasBreakpointChanges(IMarkerDelta delta, IScriptBreakpoint breakpoint) { final String[] attrs = breakpoint.getUpdatableAttributes(); try { final IMarker marker = delta.getMarker(); for (int i = 0; i < attrs.length; ++i) { final String attr = attrs[i]; final Object oldValue = delta.getAttribute(attr); final Object newValue = marker.getAttribute(attr); if (oldValue == null) { if (newValue != null) { return classifyBreakpointChange(delta, breakpoint, attr); } continue; } if (newValue == null) { return classifyBreakpointChange(delta, breakpoint, attr); } if (!oldValue.equals(newValue)) { return classifyBreakpointChange(delta, breakpoint, attr); } } } catch (CoreException e) { DLTKDebugPlugin.log(e); } return NO_CHANGES; }
/** * 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()); } } }
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; }