/** * Returns this model's annotation for the given marker. * * @param marker the marker * @return the annotation, or <code>null</code> if none */ public final MarkerAnnotation getMarkerAnnotation(IMarker marker) { Iterator<Annotation> e= getAnnotationIterator(false); while (e.hasNext()) { Object o= e.next(); if (o instanceof MarkerAnnotation) { MarkerAnnotation a= (MarkerAnnotation) o; if (marker.equals(a.getMarker())) { return a; } } } return null; }
/** * Returns this model's annotation for the given marker. * * @param marker the marker * @return the annotation, or <code>null</code> if none */ public final MarkerAnnotation getMarkerAnnotation(IMarker marker) { Iterator e= getAnnotationIterator(false); while (e.hasNext()) { Object o= e.next(); if (o instanceof MarkerAnnotation) { MarkerAnnotation a= (MarkerAnnotation) o; if (marker.equals(a.getMarker())) { return a; } } } return null; }
/** * Re-populates this model with annotations for all markers retrieved * from the maker source via <code>retrieveMarkers</code>. * * @throws CoreException if there is a problem getting the markers */ private void catchupWithMarkers() throws CoreException { for (Iterator e=getAnnotationIterator(false); e.hasNext();) { Annotation a= (Annotation) e.next(); if (a instanceof MarkerAnnotation) removeAnnotation(a, false); } IMarker[] markers= retrieveMarkers(); if (markers != null) { for (int i= 0; i < markers.length; i++) addMarkerAnnotation(markers[i]); } }
/** * Re-populates this model with annotations for all markers retrieved * from the maker source via <code>retrieveMarkers</code>. * * @throws CoreException if there is a problem getting the markers */ private void catchupWithMarkers() throws CoreException { for (Iterator<Annotation> e=getAnnotationIterator(false); e.hasNext();) { Annotation a= e.next(); if (a instanceof MarkerAnnotation) removeAnnotation(a, false); } IMarker[] markers= retrieveMarkers(); if (markers != null) { for (int i= 0; i < markers.length; i++) addMarkerAnnotation(markers[i]); } }
for (Iterator e= getAnnotationIterator(false); e.hasNext();) { Object o= e.next(); if (o instanceof MarkerAnnotation) {
for (Iterator<Annotation> e= getAnnotationIterator(false); e.hasNext();) { Object o= e.next(); if (o instanceof MarkerAnnotation) {
for (Iterator<Annotation> e= getAnnotationIterator(false); e.hasNext();) { Object o= e.next(); if (o instanceof MarkerAnnotation) {
try { IRegion line= document.getLineInformation(activeLine); it= model.getAnnotationIterator(line.getOffset(), line.getLength() + 1, true, true); } catch (BadLocationException e) { Bundle bundle= Platform.getBundle(PlatformUI.PLUGIN_ID); Platform.getLog(bundle).log(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.OK, e.getLocalizedMessage(), e)); it= model.getAnnotationIterator();
for (Iterator e= getAnnotationIterator(false); e.hasNext();) { Object o= e.next(); if (o instanceof MarkerAnnotation) {
for (Iterator it= model.getAnnotationIterator(); it.hasNext();) { Annotation annotation= (Annotation) it.next(); if (annotation instanceof MarkerAnnotation) {
return; Iterator<?> iter = model.getAnnotationIterator(); int layer = Integer.MIN_VALUE;
protected boolean hasQuickFixableAnnotationInCurrentLine() { try { AbstractMarkerAnnotationModel annotationModel = getAnnotationModel(); int line = ruler.getLineOfLastMouseButtonActivity(); IDocument document = getDocument(); IRegion region = document.getLineInformation(line); Iterator<?> iterator = annotationModel.getAnnotationIterator(region .getOffset(), region.getLength(), true, true); while (iterator.hasNext()) { Object element = iterator.next(); if (element instanceof XtextAnnotation) { XtextAnnotation annotation = (XtextAnnotation) element; if (annotation.isQuickFixable()) return true; } else if (element instanceof MarkerAnnotation) { MarkerAnnotation annotation = (MarkerAnnotation) element; if (annotation.isQuickFixableStateSet() && annotation.isQuickFixable()) return true; } } } catch (BadLocationException e) { // Ignore -> false is returned anyway } return false; }
try { IRegion line= document.getLineInformation(activeLine); it= model.getAnnotationIterator(line.getOffset(), line.getLength() + 1, true, true); } catch (BadLocationException e) { logException(new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.OK, e.getLocalizedMessage(), e)); it= model.getAnnotationIterator();
for (Iterator it= model.getAnnotationIterator(); it.hasNext();) { Annotation annotation= (Annotation) it.next(); if (annotation instanceof MarkerAnnotation) {
Iterator iter= model.getAnnotationIterator(); int layer= Integer.MIN_VALUE;
Iterator iter = model.getAnnotationIterator(); int layer = Integer.MIN_VALUE;
Iterator<Annotation> iter= model.getAnnotationIterator(); int layer= Integer.MIN_VALUE;
Iterator<Annotation> iter= model.getAnnotationIterator(); int layer= Integer.MIN_VALUE;