/** Remove annotation to this Annotatable class * @param anno annotation which will be detached from this class */ @Override protected void removeAnnotation(final Annotation anno) { super.removeAnnotation(anno); final StyledDocument doc = position.getCloneableEditorSupport().getDocument(); // document is not opened and so no annotation is attached to it if (doc == null) { return; } position.getCloneableEditorSupport().prepareDocument().waitFinished(); doc.render(new Runnable() { public void run() { synchronized (getAnnotations()) { if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } } } }); }
/** Remove annotation to this Annotatable class * @param anno annotation which will be detached from this class */ protected void removeAnnotation(Annotation anno) { super.removeAnnotation(anno); StyledDocument doc = position.getCloneableEditorSupport ().getDocument (); // document is not opened and so no annotation is attached to it if (doc == null) return; position.getCloneableEditorSupport().prepareDocument().waitFinished(); if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } }
/** Remove annotation to this Annotatable class * @param anno annotation which will be detached from this class */ protected void removeAnnotation(Annotation anno) { super.removeAnnotation(anno); StyledDocument doc = position.getCloneableEditorSupport ().getDocument (); // document is not opened and so no annotation is attached to it if (doc == null) return; position.getCloneableEditorSupport().prepareDocument().waitFinished(); if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } }