/** * {@inheritDoc} * * @see org.eclipse.debug.core.IBreakpointListener#breakpointChanged(org.eclipse.debug.core.model.IBreakpoint, * org.eclipse.core.resources.IMarkerDelta) */ public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) { if (supportsBreakpoint(breakpoint)) { try { final URI uri = ((DSLBreakpoint)breakpoint).getURI(); final IMarker marker = breakpoint.getMarker(); for (Entry<String, Object> entry : delta.getAttributes().entrySet()) { final Object markerValue = marker.getAttribute(entry.getKey()); final Object deltaValue = entry.getValue(); if ((markerValue != null && !markerValue.equals(deltaValue)) || (deltaValue != null && !deltaValue.equals(markerValue))) { if (delta.getKind() == IResourceDelta.ADDED) { factory.getDebugger().handleEvent(new ChangeBreakPointRequest(uri, entry.getKey(), (Serializable)deltaValue)); } else { factory.getDebugger().handleEvent(new ChangeBreakPointRequest(uri, entry.getKey(), (Serializable)markerValue)); } } } } catch (CoreException e) { Activator.getDefault().error(e); } } }
private boolean isProblemDelta(IResourceDelta delta) { if ((delta.getFlags() & IResourceDelta.MARKERS) == 0) { return false; } for (IMarkerDelta markerDelta : delta.getMarkerDeltas()) { if (markerDelta.isSubtypeOf(IMarker.PROBLEM)) { // Detect added/removed problem markers int kind = markerDelta.getKind(); if (kind == IResourceDelta.ADDED || kind == IResourceDelta.REMOVED) { return true; } // Detect changes in problem marker severity int oldSeverity = markerDelta.getAttribute(IMarker.SEVERITY, -1); int newSeverity = markerDelta.getMarker().getAttribute(IMarker.SEVERITY, -1); if (newSeverity != oldSeverity) { return true; } } } return false; }
protected void dispatchMarkerDelta(final IMarkerDelta iMarkerDelta, final String elementID) { switch (iMarkerDelta.getKind()) { case IResourceDelta.ADDED : addSCTIssue(iMarkerDelta, elementID); break; case IResourceDelta.REMOVED : removeSCTIssue(iMarkerDelta, elementID); break; case IResourceDelta.CHANGED : removeSCTIssue(iMarkerDelta, elementID); addSCTIssue(iMarkerDelta, elementID); break; default : break; } }
@Override public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) { if (this.isTerminated()) { return; } try { if (breakpoint instanceof BfWatchpoint) { BfWatchpoint wp = (BfWatchpoint) breakpoint; this.process.getInterpreter().removeWatchpoint(wp); } BfBreakpoint bp = this.getValidBreakpoint(breakpoint); if (bp == null) { return; } int location = bp.getCharStart(); this.process.getInterpreter().removeBreakpoint(location); this.removeInstalledBreakpoint(bp); } catch (CoreException ex) { DbgActivator.getDefault().logError("Breakpoint could not be added", ex); } }
/** * @see com.aptana.ide.core.resources.IUniformResourceChangeEvent#findMarkerDeltas(java.lang.String, boolean) */ public IMarkerDelta[] findMarkerDeltas(String type, boolean includeSubtypes) { ArrayList<IMarkerDelta> matching = new ArrayList<IMarkerDelta>(); IMarkerDelta[] deltas = getMarkerDeltas(); for( int i = 0; i < deltas.length; ++i ) { IMarkerDelta markerDelta = deltas[i]; if (type == null || (includeSubtypes ? markerDelta.isSubtypeOf(type) : markerDelta.getType().equals(type))) { matching.add(markerDelta); } } if ( matching.size() == 0 ) { return NO_MARKER_DELTAS; } return matching.toArray(new IMarkerDelta[matching.size()]); }
private boolean isErrorDelta(IResourceDelta delta) { if ((delta.getFlags() & IResourceDelta.MARKERS) != 0) { IMarkerDelta[] markerDeltas = delta.getMarkerDeltas(); for (int i = 0; i < markerDeltas.length; i++) { if (markerDeltas[i].isSubtypeOf(IMarker.PROBLEM)) { int kind = markerDeltas[i].getKind(); if (kind == IResourceDelta.ADDED || kind == IResourceDelta.REMOVED) { return true; } int severity = markerDeltas[i].getAttribute(IMarker.SEVERITY, -1); int newSeverity = markerDeltas[i].getMarker().getAttribute(IMarker.SEVERITY, -1); if (newSeverity != severity) { return true; } } } } return false; }
/** * Update the BibtextEntryView when markers change. */ public boolean visit(IResourceDelta delta) throws CoreException { if(delta == null) { return false; } IMarkerDelta[] markerDeltas = delta.getMarkerDeltas(); if(markerDeltas.length > 0){ Display.getDefault().asyncExec(new Runnable() { public void run() { refreshAction.run(); } }); } return true; }
private void checkDeltas(IMarkerDelta[] markerDeltas) throws CoreException { for (int i= 0; i < markerDeltas.length; i++) { if (isAffected(markerDeltas[i])) { IMarker marker= markerDeltas[i].getMarker(); switch (markerDeltas[i].getKind()) { case IResourceDelta.ADDED : addMarkerAnnotation(marker); fChangesApplied= true; break; case IResourceDelta.REMOVED : removeMarkerAnnotation(marker); fChangesApplied= true; break; case IResourceDelta.CHANGED: modifyMarkerAnnotation(marker); fChangesApplied= true; break; } } } }
public void resourceChanged(IResourceChangeEvent e) { if (isRunningInReconcilerThread()) return; IResourceDelta delta= e.getDelta(); IResource resource= getResource(); if (delta != null && resource != null) { IResourceDelta child= delta.findMember(resource.getFullPath()); if (child != null) { IMarkerDelta[] deltas= child.getMarkerDeltas(); int i= deltas.length; while (--i >= 0) { if (deltas[i].isSubtypeOf(IMarker.PROBLEM)) { forceReconciling(); return; } } } } }
private boolean isErrorDelta(IResourceDelta delta) { if ((delta.getFlags() & IResourceDelta.MARKERS) != 0) { IMarkerDelta[] markerDeltas= delta.getMarkerDeltas(); for (int i= 0; i < markerDeltas.length; i++) { if (markerDeltas[i].isSubtypeOf(IMarker.PROBLEM)) { int kind= markerDeltas[i].getKind(); if (kind == IResourceDelta.ADDED || kind == IResourceDelta.REMOVED) return true; int severity= markerDeltas[i].getAttribute(IMarker.SEVERITY, -1); int newSeverity= markerDeltas[i].getMarker().getAttribute(IMarker.SEVERITY, -1); if (newSeverity != severity) return true; } } } return false; }
public void breakpointChanged( IBreakpoint breakpoint, IMarkerDelta delta ) { if ( !supportsBreakpoint( breakpoint ) ) { return; } try { if ( breakpoint.isEnabled( ) ) { breakpointAdded( breakpoint ); } else { breakpointRemoved( breakpoint, null ); } } catch ( CoreException e ) { } }
public void breakpointRemoved( IBreakpoint breakpoint, IMarkerDelta delta ) { if ( !supportsBreakpoint( breakpoint ) ) { return; } JsLineBreakPoint point = new JsLineBreakPoint( ( (ScriptLineBreakpoint) breakpoint ).getSubName( ), ( (ScriptLineBreakpoint) breakpoint ).getScriptLineNumber( ) ); if ( breakPoints.contains( point ) ) { breakPoints.remove( point ); try { reportVM.removeBreakPoint( point ); } catch ( VMException e ) { logger.warning( e.getMessage( ) ); } } }
private boolean isErrorDelta(IResourceDelta delta) { if ((delta.getFlags() & IResourceDelta.MARKERS) != 0) { IMarkerDelta[] markerDeltas = delta.getMarkerDeltas(); for (int i = 0; i < markerDeltas.length; i++) { IMarkerDelta iMarkerDelta = markerDeltas[i]; if (iMarkerDelta.isSubtypeOf(IMarker.PROBLEM)) { int kind = iMarkerDelta.getKind(); if (kind == IResourceDelta.ADDED || kind == IResourceDelta.REMOVED) { return true; } int severity = iMarkerDelta.getAttribute(IMarker.SEVERITY, -1); int newSeverity = iMarkerDelta.getMarker().getAttribute(IMarker.SEVERITY, -1); if (newSeverity != severity) { return true; } } } } return false; }
protected boolean isErrorDelta(IResourceDelta delta) { if ((delta.getFlags() & IResourceDelta.MARKERS) != 0) { IMarkerDelta[] markerDeltas= delta.getMarkerDeltas(); for (int i= 0; i < markerDeltas.length; i++) { if (markerDeltas[i].isSubtypeOf(IMarker.PROBLEM)) { int kind= markerDeltas[i].getKind(); if (kind == IResourceDelta.ADDED || kind == IResourceDelta.REMOVED) return true; int severity= markerDeltas[i].getAttribute(IMarker.SEVERITY, -1); int newSeverity= markerDeltas[i].getMarker().getAttribute(IMarker.SEVERITY, -1); if (newSeverity != severity) return true; } } } return false; }
/** * {@inheritDoc} * * @see org.eclipse.debug.core.IBreakpointListener#breakpointRemoved(org.eclipse.debug.core.model.IBreakpoint, * org.eclipse.core.resources.IMarkerDelta) */ public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) { if (supportsBreakpoint(breakpoint)) { try { if (breakpoint.isEnabled()) { // TODO EMF representation of breakpoints ? final URI uri = ((DSLBreakpoint)breakpoint).getURI(); factory.getDebugger().handleEvent(new RemoveBreakpointRequest(uri)); } } catch (CoreException e) { Activator.getDefault().error(e); } } }
/** * {@inheritDoc} * * @see org.eclipse.debug.core.IBreakpointListener#breakpointRemoved(org.eclipse.debug.core.model.IBreakpoint, * org.eclipse.core.resources.IMarkerDelta) */ public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) { if (breakpoint instanceof DSLBreakpoint) { removeBreakpoint((DSLBreakpoint)breakpoint); final DSLBreakpoint dslBreakpoint = (DSLBreakpoint)breakpoint; final Set<URI> instructionURIs = new HashSet<URI>(); instructionURIs.add(dslBreakpoint.getURI()); notifySirius(instructionURIs, dslBreakpoint.getModelIdentifier()); } }
/** * {@inheritDoc} * * @see org.eclipse.debug.core.IBreakpointListener#breakpointChanged(org.eclipse.debug.core.model.IBreakpoint, * org.eclipse.core.resources.IMarkerDelta) */ public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) { try { if (breakpoint instanceof DSLBreakpoint && delta.getAttribute(IBreakpoint.ENABLED) != null && breakpoint.isEnabled() != ((Boolean)delta.getAttribute(IBreakpoint.ENABLED)) .booleanValue()) { final DSLBreakpoint dslBreakpoint = (DSLBreakpoint)breakpoint; final Set<URI> instructionURIs = new HashSet<URI>(); instructionURIs.add(dslBreakpoint.getURI()); notifySirius(instructionURIs, dslBreakpoint.getModelIdentifier()); } } catch (CoreException e) { // ignore } }
/** * {@inheritDoc} * * @see org.eclipse.debug.core.IBreakpointListener#breakpointRemoved(org.eclipse.debug.core.model.IBreakpoint, * org.eclipse.core.resources.IMarkerDelta) */ public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) { if (breakpoint instanceof DSLBreakpoint && breakpoint.getModelIdentifier().equals(getModelIdentifier())) { removeBreakpoint((DSLBreakpoint)breakpoint); fireLabelProviderChanged(breakpoint); } }
/** * {@inheritDoc} * * @see org.eclipse.debug.core.IBreakpointListener#breakpointChanged(org.eclipse.debug.core.model.IBreakpoint, * org.eclipse.core.resources.IMarkerDelta) */ public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) { try { if (breakpoint instanceof DSLBreakpoint && breakpoint.getModelIdentifier().equals(getModelIdentifier()) && delta.getAttribute(IBreakpoint.ENABLED) != null && breakpoint.isEnabled() != ((Boolean)delta.getAttribute(IBreakpoint.ENABLED)) .booleanValue()) { fireLabelProviderChanged(breakpoint); } } catch (CoreException e) { // ignore } }
@Override public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) { if (supportsBreakpoint(breakpoint)) { try { deleteBreakpointFromMap(breakpoint); sendBreakpoints(); } catch (CoreException e) { // TODO e.printStackTrace(); } } }
@Override public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) { if (supportsBreakpoint(breakpoint)) { try { if (breakpoint.isEnabled() && getBreakpointManager().isEnabled()) { breakpointAdded(breakpoint); } else { breakpointRemoved(breakpoint, null); } } catch (CoreException e) { } } }
private boolean hasMarkerDelta(IResourceChangeEvent event) { IMarkerDelta[] deltas = event.findMarkerDeltas(TLAMarkerHelper.TOOLBOX_MARKERS_ALL_MARKER_ID, true); if (deltas.length > 0) { return true; } return false; }
protected void processMarkerDelta(final IResourceDelta delta) { final IMarkerDelta[] markerDeltas = getSortedMarkerDelta(delta); for (final IMarkerDelta markerDelta : markerDeltas) { final Object elementID = markerDelta .getAttribute(SCTMarkerType.SEMANTIC_ELEMENT_ID); if (elementID == null) { continue; } dispatchMarkerDelta(markerDelta, elementID.toString()); } }
private IMarkerDelta[] getSortedMarkerDelta(final IResourceDelta delta) { IMarkerDelta[] markerDeltas = delta.getMarkerDeltas(); //sort IResourceDelta.CHANGED > IResourceDelta.REMOVED > IResourceDelta.ADDED Arrays.sort(markerDeltas, new Comparator<IMarkerDelta>(){ @Override public int compare(IMarkerDelta o1, IMarkerDelta o2) { return -((Integer)o1.getKind()).compareTo(o2.getKind()); } }); return markerDeltas; }
protected void removeSCTIssue(final IMarkerDelta iMarkerDelta, final String elementID) { final String message = (String) iMarkerDelta.getAttributes().get(IMarker.MESSAGE); final Iterator<SCTIssue> iterator = currentIssues.get(elementID).iterator(); while (iterator.hasNext()) { final SCTIssue sctIssue = iterator.next(); if (sctIssue.getMessage().equals(message)) { iterator.remove(); } } changedIssuesElementIDs.add(elementID); }
@Override public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) { System.out.printf("MontoDebugTarget.breakpointRemoved(%s, %s)\n", breakpoint, delta); Optional<Breakpoint> maybeBreakpoint = convertIBreakpointToBreakpoint(breakpoint); if (maybeBreakpoint.isPresent()) { Activator.sendCommandMessage(new CommandMessage(sessionId, 0, Commands.REMOVE_BREAKPOINT, language, GsonMonto.toJsonTree(maybeBreakpoint.get()))); } }
@Override public boolean visit(final IResourceDelta delta) { final IResource res = delta.getResource(); switch (delta.getKind()) { case IResourceDelta.ADDED: System.out.print("Resource "); System.out.print(res.getFullPath()); System.out.println(" was added."); break; case IResourceDelta.REMOVED: System.out.print("Resource "); System.out.print(res.getFullPath()); System.out.println(" was removed."); break; case IResourceDelta.CHANGED: System.out.print("Resource "); System.out.print(delta.getFullPath()); System.out.println(" has changed."); final int flags = delta.getFlags(); if ((flags & IResourceDelta.CONTENT) != 0) { System.out.println("--> Content Change"); } if ((flags & IResourceDelta.REPLACED) != 0) { System.out.println("--> Content Replaced"); } if ((flags & IResourceDelta.MARKERS) != 0) { System.out.println("--> Marker Change"); final IMarkerDelta[] markers = delta.getMarkerDeltas(); // if interested in markers, check these deltas } break; } return true; // visit the children }
/** * Returns set of properties that have changed comparing to the state saved in delta parameter. * Doesn't enumerate properties that were changed 'silently' * (see {@link #silentlyResetIgnoreCount()}). */ public Set<MutableProperty> getChangedProperty(IMarkerDelta delta) { Set<MutableProperty> result = EnumSet.noneOf(MutableProperty.class); IMarker marker = getMarker(); if (marker.getAttribute(IBreakpoint.ENABLED, Boolean.TRUE) != delta.getAttribute(IBreakpoint.ENABLED, Boolean.TRUE)) { result.add(MutableProperty.ENABLED); } if (!BasicUtil.eq(marker.getAttribute(CONDITION_ATTR, (String) null), delta.getAttribute(CONDITION_ATTR, (String) null))) { result.add(MutableProperty.CONDITION); } { IgnoreCountData currentData = IgnoreCountData.parseString(marker.getAttribute(IGNORE_COUNT_ATTR, "")); IgnoreCountData oldData = IgnoreCountData.parseString(delta.getAttribute(IGNORE_COUNT_ATTR, "")); boolean differs; if (currentData.getState() == IgnoreCountData.State.RESET) { // Ignore all changes while we are in reset state. differs = false; } else { differs = currentData.getEffectiveValue() != oldData.getEffectiveValue(); } if (differs) { result.add(MutableProperty.IGNORE_COUNT); } } return result; }
public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) { for (BreakpointMapperBase<?, ?> handler : allHandlers) { boolean res = handler.breakpointChanged(breakpoint, delta); if (res) { return; } } }
public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) { for (BreakpointMapperBase<?, ?> handler : allHandlers) { boolean res = handler.breakpointRemoved(breakpoint, delta); if (res) { return; } } }
@Override void breakpointRemoved(ChromiumLineBreakpoint lineBreakpoint, IMarkerDelta delta) { if (ChromiumLineBreakpoint.getIgnoreList().contains(lineBreakpoint)) { return; } Breakpoint sdkBreakpoint = getMap().getSdkBreakpoint(lineBreakpoint); if (sdkBreakpoint == null) { return; } if (!lineBreakpoint.isEnabled()) { return; } JavascriptVm.BreakpointCallback callback = new JavascriptVm.BreakpointCallback() { public void failure(String errorMessage) { ChromiumDebugPlugin.log(new Exception("Failed to remove breakpoint in " + //$NON-NLS-1$ getTargetNameSafe() + ": " + errorMessage)); //$NON-NLS-1$ } public void success(Breakpoint breakpoint) { } }; try { sdkBreakpoint.clear(callback, null); } catch (RuntimeException e) { ChromiumDebugPlugin.log(new Exception("Failed to remove breakpoint in " + //$NON-NLS-1$ getTargetNameSafe(), e)); } getMap().remove(lineBreakpoint); }
@Override void breakpointChanged(ChromiumExceptionBreakpoint uiBreakpoint, IMarkerDelta delta) { FakeSdkBreakpoint sdkBreakpoint = getMap().getSdkBreakpoint(uiBreakpoint); if (sdkBreakpoint == null) { return; } boolean includeCaught = uiBreakpoint.getIncludeCaught(); boolean enabled; try { enabled = uiBreakpoint.isEnabled(); } catch (CoreException e) { throw new RuntimeException(e); } boolean changed = false; synchronized (this) { if (includeCaught != sdkBreakpoint.includeCaught) { changed = true; sdkBreakpoint.includeCaught = includeCaught; } if (enabled != sdkBreakpoint.enabled) { changed = true; sdkBreakpoint.enabled = enabled; } } if (changed) { updateRemoteState(); } }
@Override void breakpointRemoved(ChromiumExceptionBreakpoint uiBreakpoint, IMarkerDelta delta) { FakeSdkBreakpoint sdkBreakpoint = getMap().getSdkBreakpoint(uiBreakpoint); if (sdkBreakpoint == null) { return; } synchronized (this) { breakpoints.remove(sdkBreakpoint); getMap().remove(uiBreakpoint); } updateRemoteState(); }
boolean breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) { UI castBreakpoint = tryCastBreakpoint(breakpoint); if (castBreakpoint == null) { return false; } breakpointChanged(castBreakpoint, delta); return true; }
boolean breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) { UI castBreakpoint = tryCastBreakpoint(breakpoint); if (castBreakpoint == null) { return false; } breakpointRemoved(castBreakpoint, delta); return true; }
/** * @see com.aptana.ide.core.resources.IUniformResourceChangeEvent#getMarkerDeltas() */ public IMarkerDelta[] getMarkerDeltas() { if ( deltas == null ) { return NO_MARKER_DELTAS; } return deltas; }