/** * Detach error annotation. */ public void detachAnnotation() { if (errAnnot != null) { errAnnot.detach(); } }
/** Attach annotation to Annotatable object. * @param anno annotatable class to which this annotation will be attached */ public final void attach(Annotatable anno) { if (attached != null) { detach(); } attached = anno; attached.addAnnotation(this); notifyAttached(attached); }
/** Detach annotation.*/ public final void detach() { if (attached != null) { attached.removeAnnotation(this); Annotatable old = attached; attached = null; notifyDetached(old); } }
public void run() { synchronized (getAnnotations()) { if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } } } });
errAnnot.detach(); errAnnot.attach(errorLine); errAnnot.moveToFront(); errorLine.show(ShowOpenType.OPEN, ShowVisibilityType.NONE);
/** * Whenever the annotation is attached to the editor, listen for line edits so we can detach the * annotation. */ protected void notifyAttached(final Annotatable toAnno) { super.notifyAttached(toAnno); docline.addPropertyChangeListener(this); }
public Annotation attachAnnotation(RadarIssue radarIssue, FileObject fileObject) throws DataObjectNotFoundException { Annotation ann = null; EditorCookie editorCookie = getEditorCookie(fileObject); if (editorCookie != null) { Line line = getLine(editorCookie); if (line != null) { ann = new SonarQubeEditorAnnotation(radarIssue.severityObject(), radarIssue.message()); ann.attach(line); } } return ann; }
public void run() { synchronized (getAnnotations()) { if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } } } });
errAnnot.detach(); errAnnot.attach(errorLine); errAnnot.moveToFront(); errorLine.show(ShowOpenType.NONE, ShowVisibilityType.NONE);
/** * Detach error annotation. */ public void detachAnnotation() { if (errAnnot != null) { errAnnot.detach(); } }
public void run() { try { synchronized (getAnnotations()) { if (!anno.isInDocument()) { anno.setInDocument(true); NbDocument.addAnnotation(doc, position.getPosition(), length, anno); } } } catch (IOException ex) { Logger.getLogger(DocumentLine.class.getName()).log(Level.WARNING, null, ex); } } });
/** Attach annotation to Annotatable object. * @param anno annotatable class to which this annotation will be attached */ public final void attach(Annotatable anno) { if (attached != null) detach(); attached = anno; attached.addAnnotation(this); notifyAttached(attached); }
/** * Whenever the annotation is detached from the editor we can stop listening for line edits. */ protected void notifyDetached(Annotatable fromAnno) { super.notifyDetached(fromAnno); docline.removePropertyChangeListener(this); }
private void removeAnnotation(Annotation annotation) { synchronized (annotationToURLLock) { String url = annotationToURL.remove (annotation); //logger.severe("Removing "+annotation+", URL = "+url+", thread = "+Thread.currentThread().getId()); //Thread.dumpStack(); assert url != null; } annotation.detach (); }
/** 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); } } } } }
/** Attach annotation to Annotatable object. * @param anno annotatable class to which this annotation will be attached */ public final void attach(Annotatable anno) { if (attached != null) detach(); attached = anno; attached.addAnnotation(this); notifyAttached(attached); }
/** Detach annotation.*/ public final void detach() { if (attached != null) { attached.removeAnnotation(this); Annotatable old = attached; attached = null; notifyDetached(old); } }
private void removeAnnotations(JPDABreakpoint b) { Annotation[] annotations = breakpointToAnnotations.remove(b); if (annotations == null) return ; for (Annotation a : annotations) { a.detach(); } }
/** 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); } } } }
/** Detach annotation.*/ public final void detach() { if (attached != null) { attached.removeAnnotation(this); Annotatable old = attached; attached = null; notifyDetached(old); } }