Package org.eclipse.jface.text.source

Examples of org.eclipse.jface.text.source.IAnnotationModel.removeAnnotation()


            if (annotationModel instanceof IAnnotationModelExtension) {
                ((IAnnotationModelExtension) annotationModel).replaceAnnotations(
                        fOccurrenceAnnotations, null);
            } else {
                for (int i = 0, length = fOccurrenceAnnotations.length; i < length; i++) {
                    annotationModel.removeAnnotation(fOccurrenceAnnotations[i]);
                }
            }
            fOccurrenceAnnotations = null;
        }
    }
View Full Code Here


                }

                log.info(lr.getLineNum());
                if (coverage.containsAnnotation(editor.getTitle(), lr)) {
                    final Annotation ann = coverage.getAnnotation(editor.getTitle(), lr);
                    annMod.removeAnnotation(ann);
                    coverage.removeAnnotation(editor.getTitle(), lr);
                }
            }
        }
    }
View Full Code Here

            } else if (annMod.getPosition(lastAnn) == null) {
                annMod.addAnnotation(lastAnn, pos);
            } else if (lastAnn.getType().equals(CoverageTypes.NO_COVERAGE)
                    && annotation.getType().equals(CoverageTypes.FULL_COVERAGE)) {

                annMod.removeAnnotation(lastAnn);
                annMod.addAnnotation(annotation, pos);
                coverage.addAnnotation(editor.getTitle(), lr, annotation);
            }

        } catch (final BadLocationException e) {
View Full Code Here

            while (it.hasNext()) {
                final Annotation annotation = (Annotation) it.next();
                if (annotation.getType().equals(CoverageTypes.FULL_COVERAGE)
                        || annotation.getType().equals(CoverageTypes.NO_COVERAGE)) {
                    annMod.removeAnnotation(annotation);
                }
            }
        }
    }
View Full Code Here

      if (annotationModel instanceof IAnnotationModelExtension) {
        ((IAnnotationModelExtension) annotationModel)
            .replaceAnnotations(fOccurrenceAnnotations, null);
      } else {
        for (int i = 0, length = fOccurrenceAnnotations.length; i < length; i++)
          annotationModel.removeAnnotation(fOccurrenceAnnotations[i]);
      }
      fOccurrenceAnnotations = null;
    }
   
   
View Full Code Here

        }
        if (doRemove) {
          if (supportsBatchReplace)
            toBeRemovedAnnotations.add(annotation);
          else
            model.removeAnnotation(annotation);
        }
      }
    }
 
    if (supportsBatchReplace && !toBeRemovedAnnotations.isEmpty()) {
View Full Code Here

  }

  private void removeAnnotations(Collection<Annotation> annotations) {
    IAnnotationModel model = getDocumentProvider().getAnnotationModel(getEditorInput());
    for (Annotation annotation : annotations) {
      model.removeAnnotation(annotation);
    }
  }

  private void addAnnotations(Map<Annotation, Position> annotationToPositionMap) {
    IAnnotationModel model = getDocumentProvider().getAnnotationModel(getEditorInput());
View Full Code Here

    } else {
      for (Iterator i = model.getAnnotationIterator(); i.hasNext();) {
        Annotation a = (Annotation) i.next();

        if (a.getType().equals(fAnnotationType)) {
          model.removeAnnotation(a);
        }
      }
    }
    // System.out.println("Annotations removed.");
    fAnnotations.clear();
View Full Code Here

    } else {
      for (Iterator i = model.getAnnotationIterator(); i.hasNext();) {
        Annotation a = (Annotation) i.next();

        if (a.getType().equals(fAnnotationType)) {
          model.removeAnnotation(a);
        }
      }
      for (PositionedMessage pm : fMessages) {
        Annotation annotation = new Annotation(fAnnotationType, false,
            pm.message);
View Full Code Here

                log.error("AnnotationModel does not "
                    + "support IAnnoationModelExtension: " + model);
                errorPrinted = true;
            }
            for (Annotation annotation : annotations) {
                model.removeAnnotation(annotation);
            }
        }
    }

    /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.