public void detachImpl() { NbDocument.removeAnnotation(document, this); }
public void run() { synchronized (getAnnotations()) { if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } } } });
public void run() { synchronized (getAnnotations()) { if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } } } });
/** When document is opened or closed the annotations must be added or * removed.*/ void attachDetachAnnotations(StyledDocument doc, boolean closing) { List<? extends Annotation> list = getAnnotations(); synchronized(list) { for (Annotation anno : list) { if (!closing) { try { if (!anno.isInDocument()) { anno.setInDocument(true); NbDocument.addAnnotation(doc, position.getPosition(), getLength(), anno); } } catch (IOException ex) { Logger.getLogger(DocumentLine.class.getName()).log(Level.WARNING, null, ex); } } else { if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } } } } }
/** When document is opened or closed the annotations must be added or * removed.*/ void attachDetachAnnotations(StyledDocument doc, boolean closing) { java.util.List list = getAnnotations(); for (int i=0; i<list.size(); i++) { Annotation anno = (Annotation)list.get(i); if (!closing) { try { if (!anno.isInDocument()) { anno.setInDocument(true); NbDocument.addAnnotation (doc, position.getPosition(), getLength(), anno); } } catch (IOException ex) { ErrorManager.getDefault ().notify ( ErrorManager.EXCEPTION, ex); } } else { if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } } } }
/** When document is opened or closed the annotations must be added or * removed.*/ void attachDetachAnnotations(StyledDocument doc, boolean closing) { java.util.List list = getAnnotations(); for (int i=0; i<list.size(); i++) { Annotation anno = (Annotation)list.get(i); if (!closing) { try { if (!anno.isInDocument()) { anno.setInDocument(true); NbDocument.addAnnotation (doc, position.getPosition(), getLength(), anno); } } catch (IOException ex) { ErrorManager.getDefault ().notify ( ErrorManager.EXCEPTION, ex); } } else { if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } } } }
if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno);
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 = pos.getCloneableEditorSupport ().getDocument (); // document is not opened and so no annotation is attached to it if (doc == null) return; pos.getCloneableEditorSupport().prepareDocument().waitFinished(); if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } }
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 = pos.getCloneableEditorSupport ().getDocument (); // document is not opened and so no annotation is attached to it if (doc == null) return; pos.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); } }
NbDocument.removeAnnotation(support.getDocument(), anno);
if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(support.getDocument(), anno);
if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(support.getDocument(), anno);