private void removeLightBulb(IAnnotationModel model) { synchronized (this) { if (fIsAnnotationShown) { model.removeAnnotation(fAnnotation); fIsAnnotationShown= false; } } }
@Override public void removeRangeIndication() { if (fRangeIndicator != null && fVisualAnnotationModel != null) fVisualAnnotationModel.removeAnnotation(fRangeIndicator); }
private void removeLightBulb(IAnnotationModel model) { synchronized (this) { if (fIsAnnotationShown) { model.removeAnnotation(fAnnotation); fIsAnnotationShown= false; } } }
public void removeAnnotation(Annotation annotation) { if(delegate != null) { delegate.removeAnnotation(annotation); } }
@Override public void removeRangeIndication() { if (fRangeIndicator != null && fVisualAnnotationModel != null) fVisualAnnotationModel.removeAnnotation(fRangeIndicator); }
private void removeLightBulb(IAnnotationModel model) { synchronized (this) { if (fIsAnnotationShown) { model.removeAnnotation(fAnnotation); fIsAnnotationShown= false; } } }
private void removeAnnotations(IAnnotationModel model, Set annotations) { if (model instanceof IAnnotationModelExtension) { IAnnotationModelExtension ame= (IAnnotationModelExtension) model; Annotation[] annotationArray= new Annotation[annotations.size()]; ame.replaceAnnotations((Annotation[]) annotations.toArray(annotationArray), Collections.EMPTY_MAP); } else { for (Iterator iter= annotations.iterator(); iter.hasNext();) { Annotation element= (Annotation) iter.next(); model.removeAnnotation(element); } } }
private void removeAnnotations(IAnnotationModel model, Set<Annotation> annotations) { if (model instanceof IAnnotationModelExtension) { IAnnotationModelExtension ame= (IAnnotationModelExtension) model; Annotation[] annotationArray= new Annotation[annotations.size()]; ame.replaceAnnotations(annotations.toArray(annotationArray), Collections.emptyMap()); } else { for (Annotation element : annotations) { model.removeAnnotation(element); } } }
private void updateAnnotationModelForRemoves(IAnnotationModel annotationModel) { 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; }
/** * Removes all override indicators from this manager's annotation model. */ void removeAnnotations() { if (fOverrideAnnotations == null) return; synchronized (fAnnotationModelLockObject) { if (fAnnotationModel instanceof IAnnotationModelExtension) { ((IAnnotationModelExtension)fAnnotationModel).replaceAnnotations(fOverrideAnnotations, null); } else { for (int i= 0, length= fOverrideAnnotations.length; i < length; i++) fAnnotationModel.removeAnnotation(fOverrideAnnotations[i]); } fOverrideAnnotations= null; } }
/** * Removes all override indicators from this manager's annotation model. */ void removeAnnotations() { if (fOverrideAnnotations == null) return; synchronized (fAnnotationModelLockObject) { if (fAnnotationModel instanceof IAnnotationModelExtension) { ((IAnnotationModelExtension)fAnnotationModel).replaceAnnotations(fOverrideAnnotations, null); } else { for (int i= 0, length= fOverrideAnnotations.length; i < length; i++) fAnnotationModel.removeAnnotation(fOverrideAnnotations[i]); } fOverrideAnnotations= null; } }
/** * Removes all override indicators from this manager's annotation model. */ void removeAnnotations() { if (fOverrideAnnotations == null) return; synchronized (fAnnotationModelLockObject) { if (fAnnotationModel instanceof IAnnotationModelExtension) { ((IAnnotationModelExtension)fAnnotationModel).replaceAnnotations(fOverrideAnnotations, null); } else { for (int i= 0, length= fOverrideAnnotations.length; i < length; i++) fAnnotationModel.removeAnnotation(fOverrideAnnotations[i]); } fOverrideAnnotations= null; } }
/** * Removes annotations from the given annotation model. The default implementation works for editors that * implement <code>ITextEditor</code>. * Subclasses may override this method. * @param annotations A set containing the annotations to be removed. * @see Annotation */ private void removeAnnotations(Collection<Annotation> annotations) { if (fModel instanceof IAnnotationModelExtension) { IAnnotationModelExtension ame= (IAnnotationModelExtension) fModel; Annotation[] annotationArray= new Annotation[annotations.size()]; ame.replaceAnnotations(annotations.toArray(annotationArray), Collections.emptyMap()); } else { for (Annotation element : annotations) { fModel.removeAnnotation(element); } } }
/** * Remove the inlined annotations. */ private void removeInlinedAnnotations() { IAnnotationModel annotationModel= fViewer.getAnnotationModel(); if (annotationModel == null || fInlinedAnnotations == null) return; synchronized (getLockObject(annotationModel)) { if (annotationModel instanceof IAnnotationModelExtension) { ((IAnnotationModelExtension) annotationModel).replaceAnnotations( fInlinedAnnotations.toArray(new Annotation[fInlinedAnnotations.size()]), null); } else { for (AbstractInlinedAnnotation annotation : fInlinedAnnotations) annotationModel.removeAnnotation(annotation); } fInlinedAnnotations= null; } }
private void removeAnnotations(Collection<Annotation> annotations) { IAnnotationModel model = getDocumentProvider().getAnnotationModel(getEditorInput()); for (Annotation annotation : annotations) { model.removeAnnotation(annotation); } }
protected void announceAnnotationChanged(Annotation annotation) { if (annotationModel instanceof XtextResourceMarkerAnnotationModel) ((XtextResourceMarkerAnnotationModel) annotationModel).fireAnnotationChangedEvent(annotation); else { Position position = annotationModel.getPosition(annotation); if (annotationModel instanceof IAnnotationModelExtension) ((IAnnotationModelExtension) annotationModel).modifyAnnotationPosition(annotation, position); else { annotationModel.removeAnnotation(annotation); annotationModel.addAnnotation(annotation, position); } } }
private void calculateLightBulb(IAnnotationModel model, IInvocationContext context) { boolean needsAnnotation= JavaCorrectionProcessor.hasAssists(context); if (fIsAnnotationShown) { model.removeAnnotation(fAnnotation); } if (needsAnnotation) { model.addAnnotation(fAnnotation, new Position(context.getSelectionOffset(), context.getSelectionLength())); } fIsAnnotationShown= needsAnnotation; }
private void calculateLightBulb(IAnnotationModel model, IInvocationContext context) { boolean needsAnnotation= JavaCorrectionProcessor.hasAssists(context); if (fIsAnnotationShown) { model.removeAnnotation(fAnnotation); } if (needsAnnotation) { model.addAnnotation(fAnnotation, new Position(context.getSelectionOffset(), context.getSelectionLength())); } fIsAnnotationShown= needsAnnotation; }
private void calculateLightBulb(IAnnotationModel model, IInvocationContext context) { boolean needsAnnotation= JavaCorrectionProcessor.hasAssists(context); if (fIsAnnotationShown) { model.removeAnnotation(fAnnotation); } if (needsAnnotation) { model.addAnnotation(fAnnotation, new Position(context.getSelectionOffset(), context.getSelectionLength())); } fIsAnnotationShown= needsAnnotation; }
/** * Remove the annotation from the document model. */ private void removeAnnotationFromModel(InstructionPointerContext ipc){ IDocumentProvider docProvider = ipc.getEditor().getDocumentProvider(); if (docProvider != null) { IAnnotationModel annotationModel = docProvider.getAnnotationModel(ipc.getEditor().getEditorInput()); if (annotationModel != null) { annotationModel.removeAnnotation(ipc.getAnnotation()); } } }