@Override protected boolean isAcceptable(IMarker marker) { if (super.isAcceptable(marker)) { return !marker.getAttribute(IAntDebugConstants.ANT_RUN_TO_LINE, false); } return false; } }
public IAnnotationModel createAnnotationModel(IPath location) { IFile file= FileBuffers.getWorkspaceFileAtLocation(location); if (file != null) return new ResourceMarkerAnnotationModel(file); return new AnnotationModel(); } }
@Override protected MarkerAnnotation createMarkerAnnotation(IMarker marker) { if (JavaMarkerAnnotation.isJavaAnnotation(marker)) return new JavaMarkerAnnotation(marker); return super.createMarkerAnnotation(marker); }
/** * Updates this model to the given marker deltas. * * @param markerDeltas the array of marker deltas */ protected void update(IMarkerDelta[] markerDeltas) { if (markerDeltas.length == 0) return; if (markerDeltas.length == 1) { IMarkerDelta delta= markerDeltas[0]; switch (delta.getKind()) { case IResourceDelta.ADDED : addMarkerAnnotation(delta.getMarker()); break; case IResourceDelta.REMOVED : removeMarkerAnnotation(delta.getMarker()); break; case IResourceDelta.CHANGED : modifyMarkerAnnotation(delta.getMarker()); break; } } else batchedUpdate(markerDeltas); fireModelChanged(); }
switch (delta.getKind()) { case IResourceDelta.ADDED: addMarkerAnnotation(delta.getMarker()); break; case IResourceDelta.REMOVED: return; Iterator<Annotation> e= getAnnotationIterator(false); while (e.hasNext()) { Object o= e.next(); removeAnnotation(a, false); Position p= createPositionFromMarker(marker); if (p != null) { a.update(); modifyAnnotationPosition(a, p, false); addMarkerAnnotation(iter.next());
@Override protected void removeAnnotation(Annotation annotation, boolean fireModelChanged) { Position position= getPosition(annotation); synchronized (getLockObject()) { Object cached= fReverseMap.get(position); if (cached instanceof List) { @SuppressWarnings("unchecked") List<Object> list= (List<Object>) cached; list.remove(annotation); if (list.size() == 1) { fReverseMap.put(position, list.get(0)); list.clear(); } } else if (cached instanceof Annotation) { fReverseMap.remove(position); } } super.removeAnnotation(annotation, fireModelChanged); } }
@Override protected void removeAllAnnotations(boolean fireModelChanged) { super.removeAllAnnotations(fireModelChanged); synchronized (getLockObject()) { fReverseMap.clear(); } }
@Override public void updateMarkers(IDocument document) throws CoreException { if (!this.connected) { return; } super.updateMarkers(document); }
protected void addAnnotation(Annotation annotation, Position position, boolean fireModelChanged) throws BadLocationException { super.addAnnotation(annotation, position, fireModelChanged); synchronized (getLockObject()) { Object cached= fReverseMap.get(position); if (cached == null) fReverseMap.put(position, annotation); else if (cached instanceof List) { List list= (List) cached; list.add(annotation); } else if (cached instanceof Annotation) { List list= new ArrayList(2); list.add(cached); list.add(annotation); fReverseMap.put(position, list); } } }
/** * Updates this model to the given marker deltas. * * @param markerDeltas the array of marker deltas */ protected void update(IMarkerDelta[] markerDeltas) { if (markerDeltas.length == 0) return; for (int i= 0; i < markerDeltas.length; i++) { IMarkerDelta delta= markerDeltas[i]; switch (delta.getKind()) { case IResourceDelta.ADDED : addMarkerAnnotation(delta.getMarker()); break; case IResourceDelta.REMOVED : removeMarkerAnnotation(delta.getMarker()); break; case IResourceDelta.CHANGED : modifyMarkerAnnotation(delta.getMarker()); break; } } fireModelChanged(); }
protected void removeAnnotation(Annotation annotation, boolean fireModelChanged) { Position position= getPosition(annotation); synchronized (getLockObject()) { Object cached= fReverseMap.get(position); if (cached instanceof List) { List list= (List) cached; list.remove(annotation); if (list.size() == 1) { fReverseMap.put(position, list.get(0)); list.clear(); } } else if (cached instanceof Annotation) { fReverseMap.remove(position); } } super.removeAnnotation(annotation, fireModelChanged); } }
protected void removeAllAnnotations(boolean fireModelChanged) { super.removeAllAnnotations(fireModelChanged); synchronized (getLockObject()) { fReverseMap.clear(); } }
model.updateMarkers(info.fDocument);
@Override protected void addAnnotation(Annotation annotation, Position position, boolean fireModelChanged) throws BadLocationException { super.addAnnotation(annotation, position, fireModelChanged); synchronized (getLockObject()) { Object cached= fReverseMap.get(position); if (cached == null) fReverseMap.put(position, annotation); else if (cached instanceof List) { @SuppressWarnings("unchecked") List<Object> list= (List<Object>) cached; list.add(annotation); } else if (cached instanceof Annotation) { List<Object> list= new ArrayList<>(2); list.add(cached); list.add(annotation); fReverseMap.put(position, list); } } }
@Override protected boolean isAcceptable(IMarker marker) { if (!super.isAcceptable(marker)) return false; Object markerURI; try { markerURI = marker.getAttribute(MARKER_URI); return markerURI != null && markerURI.equals(fullURI.toString()); } catch (CoreException e) { log.error(e); return false; } }
@Override protected void removeAnnotation(Annotation annotation, boolean fireModelChanged) { Position position= getPosition(annotation); synchronized (getLockObject()) { Object cached= fReverseMap.get(position); if (cached instanceof List) { @SuppressWarnings("unchecked") List<Object> list= (List<Object>) cached; list.remove(annotation); if (list.size() == 1) { fReverseMap.put(position, list.get(0)); list.clear(); } } else if (cached instanceof Annotation) { fReverseMap.remove(position); } } super.removeAnnotation(annotation, fireModelChanged); } }
protected IAnnotationModel createAnnotationModel(Object element) throws CoreException { if (element instanceof IFileEditorInput) { IFileEditorInput input= (IFileEditorInput) element; return new ResourceMarkerAnnotationModel(input.getFile()); } return super.createAnnotationModel(element); }
@Override protected void removeAllAnnotations(boolean fireModelChanged) { super.removeAllAnnotations(fireModelChanged); synchronized (getLockObject()) { fReverseMap.clear(); } }
@Override protected MarkerAnnotation createMarkerAnnotation(IMarker marker) { if (JavaMarkerAnnotation.isJavaAnnotation(marker)) return new JavaMarkerAnnotation(marker); return super.createMarkerAnnotation(marker); }
model.updateMarkers(info.fDocument);