@Override public void removeAnnotation(Annotation annotation) { removeAnnotation(annotation, true); }
@Override public void removeAnnotation(Annotation annotation) { removeAnnotation(annotation, true); }
/** * Removes the given annotations from this model. If requested all * annotation model listeners will be informed about this change. * <code>modelInitiated</code> indicates whether the deletion has * been initiated by this model or by one of its clients. * * @param annotations the annotations to be removed * @param fireModelChanged indicates whether to notify all model listeners * @param modelInitiated indicates whether this changes has been initiated by this model */ protected void removeAnnotations(List<? extends Annotation> annotations, boolean fireModelChanged, boolean modelInitiated) { if (annotations.size() > 0) { Iterator<? extends Annotation> e= annotations.iterator(); while (e.hasNext()) removeAnnotation(e.next(), false); if (fireModelChanged) fireModelChanged(); } }
/** * Removes the given annotations from this model. If requested all * annotation model listeners will be informed about this change. * <code>modelInitiated</code> indicates whether the deletion has * been initiated by this model or by one of its clients. * * @param annotations the annotations to be removed * @param fireModelChanged indicates whether to notify all model listeners * @param modelInitiated indicates whether this changes has been initiated by this model */ protected void removeAnnotations(List<? extends Annotation> annotations, boolean fireModelChanged, boolean modelInitiated) { if (annotations.size() > 0) { Iterator<? extends Annotation> e= annotations.iterator(); while (e.hasNext()) removeAnnotation(e.next(), false); if (fireModelChanged) fireModelChanged(); } }
/** * Replaces the given annotations in this model and if advised fires a * model change event. * * @param annotationsToRemove the annotations to be removed * @param annotationsToAdd the annotations to be added * @param fireModelChanged <code>true</code> if a model change event * should be fired, <code>false</code> otherwise * @throws BadLocationException in case an annotation should be added at an * invalid position * @since 3.0 */ protected void replaceAnnotations(Annotation[] annotationsToRemove, Map<? extends Annotation, ? extends Position> annotationsToAdd, boolean fireModelChanged) throws BadLocationException { if (annotationsToRemove != null) { for (int i= 0, length= annotationsToRemove.length; i < length; i++) removeAnnotation(annotationsToRemove[i], false); } if (annotationsToAdd != null) { Iterator<? extends Entry<? extends Annotation, ? extends Position>> iter= annotationsToAdd.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<? extends Annotation, ? extends Position> mapEntry= iter.next(); Annotation annotation= mapEntry.getKey(); Position position= mapEntry.getValue(); addAnnotation(annotation, position, false); } } if (fireModelChanged) fireModelChanged(); }
/** * Replaces the given annotations in this model and if advised fires a * model change event. * * @param annotationsToRemove the annotations to be removed * @param annotationsToAdd the annotations to be added * @param fireModelChanged <code>true</code> if a model change event * should be fired, <code>false</code> otherwise * @throws BadLocationException in case an annotation should be added at an * invalid position * @since 3.0 */ protected void replaceAnnotations(Annotation[] annotationsToRemove, Map<? extends Annotation, ? extends Position> annotationsToAdd, boolean fireModelChanged) throws BadLocationException { if (annotationsToRemove != null) { for (Annotation element : annotationsToRemove) removeAnnotation(element, false); } if (annotationsToAdd != null) { Iterator<? extends Entry<? extends Annotation, ? extends Position>> iter= annotationsToAdd.entrySet().iterator(); while (iter.hasNext()) { Map.Entry<? extends Annotation, ? extends Position> mapEntry= iter.next(); Annotation annotation= mapEntry.getKey(); Position position= mapEntry.getValue(); addAnnotation(annotation, position, false); } } if (fireModelChanged) fireModelChanged(); }
removeAnnotation(annotation, fireModelChanged); } else { Position p= fAnnotations.get(annotation);
removeAnnotation(annotation, fireModelChanged); } else { Position p= fAnnotations.get(annotation);